-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_schema.sql
More file actions
25 lines (23 loc) · 1017 Bytes
/
test_schema.sql
File metadata and controls
25 lines (23 loc) · 1017 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
CREATE TABLE "_params" (
"id" TEXT PRIMARY KEY DEFAULT ('r'||substring(md5(random()::text) from 1 for 14)) NOT NULL,
"value" JSON DEFAULT NULL,
"created" TEXT DEFAULT '' NOT NULL,
"updated" TEXT DEFAULT '' NOT NULL
);
CREATE TABLE "collections" (
"id" TEXT PRIMARY KEY DEFAULT ('r'||substring(md5(random()::text) from 1 for 14)) NOT NULL,
"system" BOOLEAN DEFAULT FALSE NOT NULL,
"type" TEXT DEFAULT 'base' NOT NULL,
"name" TEXT UNIQUE NOT NULL,
"fields" JSON DEFAULT '[]' NOT NULL,
"indexes" JSON DEFAULT '[]' NOT NULL,
"listRule" TEXT DEFAULT NULL,
"viewRule" TEXT DEFAULT NULL,
"createRule" TEXT DEFAULT NULL,
"updateRule" TEXT DEFAULT NULL,
"deleteRule" TEXT DEFAULT NULL,
"options" JSON DEFAULT '{}' NOT NULL,
"created" TEXT DEFAULT '' NOT NULL,
"updated" TEXT DEFAULT '' NOT NULL
);
CREATE INDEX IF NOT EXISTS "idx__collections_type" on "collections" ("type");