Skip to content

Commit

Permalink
feat: add SQL migration for remote connection metadata (#22237)
Browse files Browse the repository at this point in the history
  • Loading branch information
danxmoran authored Aug 17, 2021
1 parent 5c7c6c2 commit 2237d02
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions sqlite/migrations/0003_create_remotes_table.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
-- The user_version should match the "000X" from the file name
-- Ex: 0001_create_notebooks_table should have a user_verison of 1
PRAGMA user_version=3;

CREATE TABLE remotes (
id VARCHAR(16) NOT NULL PRIMARY KEY,
org_id VARCHAR(16) NOT NULL,
name TEXT NOT NULL,
description TEXT,
remote_url TEXT NOT NULL,
remote_api_token TEXT NOT NULL,
remote_org_id VARCHAR(16) NOT NULL,
allow_insecure_tls BOOLEAN NOT NULL,
created_at TIMESTAMP NOT NULL,
updated_at TIMESTAMP NOT NULL,

CONSTRAINT remotes_uniq_orgid_name UNIQUE (org_id, name)
);

-- Create indexes on lookup patterns we expect to be common
CREATE INDEX idx_remote_url_per_org ON remotes (org_id, remote_url);

0 comments on commit 2237d02

Please sign in to comment.