Skip to content

Instantly share code, notes, and snippets.

@adrianparvino
Created August 2, 2019 22:54
Show Gist options
  • Save adrianparvino/3e180f4fb0c00f6609c087959a0c885a to your computer and use it in GitHub Desktop.
Save adrianparvino/3e180f4fb0c00f6609c087959a0c885a to your computer and use it in GitHub Desktop.
CREATE TABLE SchemaVersion(
version integer not null
);
CREATE TABLE Deployments(
uuid text primary key
);
CREATE TABLE DeploymentAttrs(
deployment text not null,
name text not null,
value text not null,
primary key(deployment, name),
foreign key(deployment) references Deployments(uuid) on delete cascade
);
CREATE TABLE Resources(
id integer primary key autoincrement,
deployment text not null,
name text not null,
type text not null,
foreign key(deployment) references Deployments(uuid) on delete cascade
);
CREATE TABLE sqlite_sequence(name,seq);
CREATE TABLE ResourceAttrs(
machine integer not null,
name text not null,
value text not null,
primary key(machine, name),
foreign key(machine) references Resources(id) on delete cascade
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment