mirror of
https://github.com/lxc/incus
synced 2026-08-02 05:26:46 +00:00
This re-organizes the test/ directory in prevision for adding support for the different backing stores. This is solely about moving files around and updating the code style to be consistent across all files, no change to the actual code is included in this commit. Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
52 lines
1.6 KiB
SQL
52 lines
1.6 KiB
SQL
-- Database schema version 1 as taken from febb96e8164fbd189698da77383c26ce68b9762a
|
|
CREATE TABLE certificates (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
|
|
fingerprint VARCHAR(255) NOT NULL,
|
|
type INTEGER NOT NULL,
|
|
name VARCHAR(255) NOT NULL,
|
|
certificate TEXT NOT NULL,
|
|
UNIQUE (fingerprint)
|
|
);
|
|
CREATE TABLE containers (
|
|
id INTEGER primary key AUTOINCREMENT NOT NULL,
|
|
name VARCHAR(255) NOT NULL,
|
|
architecture INTEGER NOT NULL,
|
|
type INTEGER NOT NULL,
|
|
UNIQUE (name)
|
|
);
|
|
CREATE TABLE containers_config (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
|
|
container_id INTEGER NOT NULL,
|
|
key VARCHAR(255) NOT NULL,
|
|
value TEXT,
|
|
FOREIGN KEY (container_id) REFERENCES containers (id),
|
|
UNIQUE (container_id, key)
|
|
);
|
|
CREATE TABLE images (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
|
|
fingerprint VARCHAR(255) NOT NULL,
|
|
filename VARCHAR(255) NOT NULL,
|
|
size INTEGER NOT NULL,
|
|
public INTEGER NOT NULL DEFAULT 0,
|
|
architecture INTEGER NOT NULL,
|
|
creation_date DATETIME,
|
|
expiry_date DATETIME,
|
|
upload_date DATETIME NOT NULL,
|
|
UNIQUE (fingerprint)
|
|
);
|
|
CREATE TABLE images_properties (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
|
|
image_id INTEGER NOT NULL,
|
|
type INTEGER NOT NULL,
|
|
key VARCHAR(255) NOT NULL,
|
|
value TEXT,
|
|
FOREIGN KEY (image_id) REFERENCES images (id)
|
|
);
|
|
CREATE TABLE schema (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
|
|
version INTEGER NOT NULL,
|
|
updated_at DATETIME NOT NULL,
|
|
UNIQUE (version)
|
|
);
|
|
INSERT INTO schema (version, updated_at) values (1, "now");
|