Added create_at fields on playlists and bookmarks.

This commit is contained in:
Jonathan Bernard 2016-03-08 09:45:51 -06:00
parent 47590a8c8f
commit 8edf542726
3 changed files with 8 additions and 2 deletions

View File

@ -1,11 +1,14 @@
package com.jdbernard.wdiwtlt.db.models; package com.jdbernard.wdiwtlt.db.models;
import java.util.Date;
public class Bookmark extends Model { public class Bookmark extends Model {
public String name; public String name;
public int playlistId; public int playlistId;
public int mediaFileId; public int mediaFileId;
public int playIndex; public int playIndex;
public boolean user_created; public boolean user_created;
public Date createdAt = new Date();
public String toString() { return name; } public String toString() { return name; }
} }

View File

@ -10,6 +10,7 @@ public class Playlist extends Model {
public int modCount = 0; public int modCount = 0;
public int mediaFileCount = 0; public int mediaFileCount = 0;
public Integer copiedFromId = null; public Integer copiedFromId = null;
public Date createdAt = new Date()t;
public String toString() { public String toString() {
if (userCreated) return name; if (userCreated) return name;

View File

@ -53,7 +53,8 @@ CREATE TABLE playlists (
name VARCHAR NOT NULL, name VARCHAR NOT NULL,
mod_count INTEGER NOT NULL DEFAULT 0, mod_count INTEGER NOT NULL DEFAULT 0,
media_file_count INTEGER NOT NULL DEFAULT 0, media_file_count INTEGER NOT NULL DEFAULT 0,
copied_from_id INTEGER REFERENCES playlists(id) DEFAULT NULL copied_from_id INTEGER REFERENCES playlists(id) DEFAULT NULL,
created_at TIMESTAMP NOT NULL DEFAULT NOW()
); );
CREATE TABLE playlists_media_files ( CREATE TABLE playlists_media_files (
@ -69,7 +70,8 @@ CREATE TABLE bookmarks (
user_created BOOLEAN NOT NULL DEFAULT FALSE, user_created BOOLEAN NOT NULL DEFAULT FALSE,
playlist_id INTEGER NOT NULL REFERENCES playlists(id) ON DELETE CASCADE, playlist_id INTEGER NOT NULL REFERENCES playlists(id) ON DELETE CASCADE,
media_file_id INTEGER NOT NULL REFERENCES media_files(id) ON DELETE CASCADE, media_file_id INTEGER NOT NULL REFERENCES media_files(id) ON DELETE CASCADE,
play_index INTEGER NOT NULL play_index INTEGER NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT NOW()
); );
CREATE TABLE media_files_tags ( CREATE TABLE media_files_tags (