mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Add integrations table in db
This commit is contained in:
parent
f6df97c85d
commit
1e1b573c52
2 changed files with 32 additions and 0 deletions
23
packages/db/migrations/0090.do.integrations.sql
Executable file
23
packages/db/migrations/0090.do.integrations.sql
Executable file
|
|
@ -0,0 +1,23 @@
|
|||
-- Type: DO
|
||||
-- Name: integrations
|
||||
-- Description: Create integrations table
|
||||
|
||||
BEGIN;
|
||||
|
||||
CREATE TABLE omnivore.integrations (
|
||||
id uuid PRIMARY KEY DEFAULT uuid_generate_v1mc(),
|
||||
user_id uuid NOT NULL REFERENCES omnivore.user ON DELETE CASCADE,
|
||||
name varchar(50) NOT NULL,
|
||||
token varchar(255) NOT NULL,
|
||||
enabled boolean NOT NULL DEFAULT true,
|
||||
description varchar(255),
|
||||
url varchar(255),
|
||||
created_at timestamptz NOT NULL DEFAULT current_timestamp,
|
||||
updated_at timestamptz NOT NULL DEFAULT current_timestamp,
|
||||
UNIQUE (user_id, name)
|
||||
);
|
||||
|
||||
CREATE TRIGGER update_integration_modtime BEFORE UPDATE ON omnivore.integrations
|
||||
FOR EACH ROW EXECUTE PROCEDURE update_updated_at_column();
|
||||
|
||||
COMMIT;
|
||||
9
packages/db/migrations/0090.undo.integrations.sql
Executable file
9
packages/db/migrations/0090.undo.integrations.sql
Executable file
|
|
@ -0,0 +1,9 @@
|
|||
-- Type: UNDO
|
||||
-- Name: integrations
|
||||
-- Description: Create integrations table
|
||||
|
||||
BEGIN;
|
||||
|
||||
DROP TABLE IF EXISTS omnivore.integrations;
|
||||
|
||||
COMMIT;
|
||||
Loading…
Reference in a new issue