3
CREATE TEMPORARY TABLE images_backup (
7
status VARCHAR(30) NOT NULL,
8
is_public BOOLEAN NOT NULL,
10
created_at DATETIME NOT NULL,
13
deleted BOOLEAN NOT NULL,
14
disk_format VARCHAR(20),
15
container_format VARCHAR(20),
21
CHECK (is_public IN (0, 1)),
22
CHECK (deleted IN (0, 1))
25
INSERT INTO images_backup
26
SELECT id, name, size, status, is_public, location, created_at, updated_at, deleted_at, deleted, disk_format, container_format, checksum, owner, min_disk, min_ram
35
status VARCHAR(30) NOT NULL,
36
is_public BOOLEAN NOT NULL,
38
created_at DATETIME NOT NULL,
41
deleted BOOLEAN NOT NULL,
42
disk_format VARCHAR(20),
43
container_format VARCHAR(20),
46
min_disk INTEGER NOT NULL,
47
min_ram INTEGER NOT NULL,
49
CHECK (is_public IN (0, 1)),
50
CHECK (deleted IN (0, 1))
53
CREATE INDEX ix_images_deleted ON images (deleted);
54
CREATE INDEX ix_images_is_public ON images (is_public);
58
SELECT id, name, size, status, is_public, location, created_at, updated_at, deleted_at, deleted, disk_format, container_format, checksum, owner, min_disk, min_ram
61
DROP TABLE images_backup;