Added a suite GUID
This commit is contained in:
parent
30d99eeb9e
commit
329de2f953
11 changed files with 44 additions and 41 deletions
|
|
@ -7,10 +7,11 @@ SELECT * FROM sites WHERE id = ?;
|
|||
-- name: InsertSite :one
|
||||
INSERT INTO sites (
|
||||
owner_id,
|
||||
guid,
|
||||
title,
|
||||
tagline,
|
||||
created_at
|
||||
) VALUES (?, ?, ?, ?)
|
||||
) VALUES (?, ?, ?, ?, ?)
|
||||
RETURNING id;
|
||||
|
||||
-- name: HasUsersAndSites :one
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ CREATE UNIQUE INDEX idx_users_username ON users (username);
|
|||
CREATE TABLE sites (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
owner_id INTEGER NOT NULL,
|
||||
guid TEXT NOT NULL,
|
||||
title TEXT NOT NULL,
|
||||
tagline TEXT NOT NULL,
|
||||
created_at INTEGER NOT NULL,
|
||||
|
|
@ -16,6 +17,7 @@ CREATE TABLE sites (
|
|||
FOREIGN KEY (owner_id) REFERENCES users (id) ON DELETE CASCADE
|
||||
);
|
||||
CREATE INDEX idx_site_owner ON sites (owner_id);
|
||||
CREATE UNIQUE INDEX idx_site_guid ON sites (guid);
|
||||
|
||||
CREATE TABLE publish_targets (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue