archives: use separate table
Cleaner to separate things from the backups table. * icon, appConfig, appStoreIcon etc are only valid for archives * older version cloudron does not have appConfig in backups table (so it cannot be an archive entry)
This commit is contained in:
@@ -156,14 +156,21 @@ CREATE TABLE IF NOT EXISTS backups(
|
||||
manifestJson TEXT, /* to validate if the app can be installed in this version of box */
|
||||
format VARCHAR(16) DEFAULT "tgz",
|
||||
preserveSecs INTEGER DEFAULT 0,
|
||||
archive BOOLEAN DEFAULT 0,
|
||||
appStoreIcon MEDIUMBLOB, /* only valid with archive */
|
||||
icon MEDIUMBLOB, /* only valid with archive */
|
||||
appConfigJson TEXT, /* only valid with archive */
|
||||
|
||||
INDEX creationTime_index (creationTime),
|
||||
PRIMARY KEY (id));
|
||||
|
||||
CREATE TABLE IF NOT EXISTS archives(
|
||||
id VARCHAR(128) NOT NULL UNIQUE,
|
||||
backupId VARCHAR(128) NOT NULL,
|
||||
creationTime TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
appStoreIcon MEDIUMBLOB,
|
||||
icon MEDIUMBLOB,
|
||||
appConfigJson TEXT,
|
||||
|
||||
FOREIGN KEY(backupId) REFERENCES backups(id),
|
||||
PRIMARY KEY (id));
|
||||
|
||||
CREATE TABLE IF NOT EXISTS eventlog(
|
||||
id VARCHAR(128) NOT NULL,
|
||||
action VARCHAR(128) NOT NULL,
|
||||
|
||||
Reference in New Issue
Block a user