diff --git a/core/src/main/java/com/jdbernard/wdiwtlt/db/models/MediaFile.java b/core/src/main/java/com/jdbernard/wdiwtlt/db/models/MediaFile.java index c581f21..8cbe517 100644 --- a/core/src/main/java/com/jdbernard/wdiwtlt/db/models/MediaFile.java +++ b/core/src/main/java/com/jdbernard/wdiwtlt/db/models/MediaFile.java @@ -1,6 +1,7 @@ package com.jdbernard.wdiwtlt.db.models; import java.util.Date; +import java.sql.Timestamp; public class MediaFile extends Model { public static final String TAG_INFO = "tag info"; @@ -12,7 +13,7 @@ public class MediaFile extends Model { public String filePath; public String fileHash; public String metaInfoSource = TAG_INFO; - public Date dateAdded; + public Date dateAdded = new Timestamp(new Date().getTime()); public String comment; public String toString() { return name; } diff --git a/core/src/main/java/com/jdbernard/wdiwtlt/db/models/Playlist.java b/core/src/main/java/com/jdbernard/wdiwtlt/db/models/Playlist.java index 04f4259..36437ff 100644 --- a/core/src/main/java/com/jdbernard/wdiwtlt/db/models/Playlist.java +++ b/core/src/main/java/com/jdbernard/wdiwtlt/db/models/Playlist.java @@ -1,13 +1,15 @@ package com.jdbernard.wdiwtlt.db.models; +import java.sql.Timestamp; import java.util.Date; public class Playlist extends Model { public boolean userCreated; - public Date lastUsed; + public Timestamp lastUsed = new Timestamp(new Date().getTime()); public String name; public int modCount; public int mediaFileCount; + public Integer copiedFromId; public String toString() { return name; } } diff --git a/core/src/main/sql/migrations/20151209054632-initial-schema-up.sql b/core/src/main/sql/migrations/20151209054632-initial-schema-up.sql index f30e6c2..203c25f 100644 --- a/core/src/main/sql/migrations/20151209054632-initial-schema-up.sql +++ b/core/src/main/sql/migrations/20151209054632-initial-schema-up.sql @@ -51,7 +51,8 @@ CREATE TABLE playlists ( last_used TIMESTAMP NOT NULL DEFAULT NOW(), name VARCHAR NOT NULL, 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) ); CREATE TABLE playlists_media_files (