FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
drupaljs/sql/init.sql at main · ruvnet/drupaljs · GitHub
ruvnet
/
drupaljs
Public
Notifications
You must be signed in to change notification settings
Fork
5
Star
38
Code
Issues
2
Pull requests
1
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
drupaljs
/
sql
/
init.sql
Copy path
More file actions
More file actions
Latest commit
History
History
History
90 lines (81 loc) · 2.85 KB
Breadcrumbs
drupaljs
/
sql
/
init.sql
Copy path
File metadata and controls
90 lines (81 loc) · 2.85 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
--
Initialize Drupal.js database schema
--
Users table
CREATE
TABLE
users
(
id UUID
PRIMARY KEY
DEFAULT uuid_generate_v4(),
username
TEXT
UNIQUE
NOT NULL
,
email
TEXT
UNIQUE
NOT NULL
,
password_hash
TEXT
NOT NULL
,
created_at
TIMESTAMP WITH TIME ZONE
DEFAULT
CURRENT_TIMESTAMP
,
updated_at
TIMESTAMP WITH TIME ZONE
DEFAULT
CURRENT_TIMESTAMP
);
--
Content types table
CREATE
TABLE
content_types
(
id UUID
PRIMARY KEY
DEFAULT uuid_generate_v4(),
name
TEXT
UNIQUE
NOT NULL
,
description
TEXT
,
created_at
TIMESTAMP WITH TIME ZONE
DEFAULT
CURRENT_TIMESTAMP
,
updated_at
TIMESTAMP WITH TIME ZONE
DEFAULT
CURRENT_TIMESTAMP
);
--
Content table
CREATE
TABLE
content
(
id UUID
PRIMARY KEY
DEFAULT uuid_generate_v4(),
content_type_id UUID
REFERENCES
content_types(id),
title
TEXT
NOT NULL
,
body
TEXT
,
author_id UUID
REFERENCES
users(id),
created_at
TIMESTAMP WITH TIME ZONE
DEFAULT
CURRENT_TIMESTAMP
,
updated_at
TIMESTAMP WITH TIME ZONE
DEFAULT
CURRENT_TIMESTAMP
,
published_at
TIMESTAMP WITH TIME ZONE
);
--
Taxonomies table
CREATE
TABLE
taxonomies
(
id UUID
PRIMARY KEY
DEFAULT uuid_generate_v4(),
name
TEXT
UNIQUE
NOT NULL
,
description
TEXT
,
created_at
TIMESTAMP WITH TIME ZONE
DEFAULT
CURRENT_TIMESTAMP
,
updated_at
TIMESTAMP WITH TIME ZONE
DEFAULT
CURRENT_TIMESTAMP
);
--
Terms table
CREATE
TABLE
terms
(
id UUID
PRIMARY KEY
DEFAULT uuid_generate_v4(),
taxonomy_id UUID
REFERENCES
taxonomies(id),
name
TEXT
NOT NULL
,
description
TEXT
,
parent_id UUID
REFERENCES
terms(id),
created_at
TIMESTAMP WITH TIME ZONE
DEFAULT
CURRENT_TIMESTAMP
,
updated_at
TIMESTAMP WITH TIME ZONE
DEFAULT
CURRENT_TIMESTAMP
);
--
Content-Term relationship table
CREATE
TABLE
content_terms
(
content_id UUID
REFERENCES
content(id),
term_id UUID
REFERENCES
terms(id),
PRIMARY KEY
(content_id, term_id)
);
--
Comments table
CREATE
TABLE
comments
(
id UUID
PRIMARY KEY
DEFAULT uuid_generate_v4(),
content_id UUID
REFERENCES
content(id),
author_id UUID
REFERENCES
users(id),
body
TEXT
NOT NULL
,
created_at
TIMESTAMP WITH TIME ZONE
DEFAULT
CURRENT_TIMESTAMP
,
updated_at
TIMESTAMP WITH TIME ZONE
DEFAULT
CURRENT_TIMESTAMP
);
--
Menus table
CREATE
TABLE
menus
(
id UUID
PRIMARY KEY
DEFAULT uuid_generate_v4(),
name
TEXT
UNIQUE
NOT NULL
,
description
TEXT
,
created_at
TIMESTAMP WITH TIME ZONE
DEFAULT
CURRENT_TIMESTAMP
,
updated_at
TIMESTAMP WITH TIME ZONE
DEFAULT
CURRENT_TIMESTAMP
);
--
Menu items table
CREATE
TABLE
menu_items
(
id UUID
PRIMARY KEY
DEFAULT uuid_generate_v4(),
menu_id UUID
REFERENCES
menus(id),
parent_id UUID
REFERENCES
menu_items(id),
title
TEXT
NOT NULL
,
link
TEXT
NOT NULL
,
weight
INTEGER
DEFAULT
0
,
created_at
TIMESTAMP WITH TIME ZONE
DEFAULT
CURRENT_TIMESTAMP
,
updated_at
TIMESTAMP WITH TIME ZONE
DEFAULT
CURRENT_TIMESTAMP
);
Back
|
FazBrowse Home
|
New Git URL