@dbml/cli 3.8.0 → 3.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,3 +1,33 @@
|
|
|
1
|
+
Enum "dbml_test"."enum_type1" {
|
|
2
|
+
"value1"
|
|
3
|
+
"value2"
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
Enum "dbml_test"."enum_type3" {
|
|
7
|
+
"value4"
|
|
8
|
+
"value5"
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
Table "dbml_test"."table1" {
|
|
12
|
+
"id" int4 [pk, not null, increment]
|
|
13
|
+
"status" dbml_test.enum_type1
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
Table "dbml_test"."table3" {
|
|
17
|
+
"id" int4 [pk, not null, increment]
|
|
18
|
+
"status" dbml_test.enum_type3
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
Enum "enum_type1" {
|
|
22
|
+
"value1"
|
|
23
|
+
"value2"
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
Enum "enum_type2" {
|
|
27
|
+
"value1"
|
|
28
|
+
"value3"
|
|
29
|
+
}
|
|
30
|
+
|
|
1
31
|
Enum "gender_type" {
|
|
2
32
|
"Male"
|
|
3
33
|
"Female"
|
|
@@ -94,6 +124,16 @@ Table "products" {
|
|
|
94
124
|
}
|
|
95
125
|
}
|
|
96
126
|
|
|
127
|
+
Table "table1" {
|
|
128
|
+
"id" int4 [pk, not null, increment]
|
|
129
|
+
"status" enum_type1
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
Table "table2" {
|
|
133
|
+
"id" int4 [pk, not null, increment]
|
|
134
|
+
"status" enum_type2
|
|
135
|
+
}
|
|
136
|
+
|
|
97
137
|
Table "table_with_comments" {
|
|
98
138
|
"id" int4 [pk, not null, increment, note: 'Unique identifier for each item.']
|
|
99
139
|
"name" varchar(100) [note: 'Name of the item.']
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
-- Create users table
|
|
2
|
+
CREATE SCHEMA dbml_test;
|
|
3
|
+
|
|
2
4
|
CREATE TABLE users (
|
|
3
5
|
user_id SERIAL PRIMARY KEY,
|
|
4
6
|
username VARCHAR(50) UNIQUE NOT NULL,
|
|
@@ -154,3 +156,32 @@ CREATE TABLE Books (
|
|
|
154
156
|
CONSTRAINT FK_AuthorNationality FOREIGN KEY (AuthorID, NationalityID)
|
|
155
157
|
REFERENCES Authors (AuthorID, NationalityID) ON DELETE CASCADE
|
|
156
158
|
);
|
|
159
|
+
|
|
160
|
+
-- Create enum types in the public schema
|
|
161
|
+
CREATE TYPE public.enum_type1 AS ENUM ('value1', 'value2');
|
|
162
|
+
CREATE TYPE public.enum_type2 AS ENUM ('value1', 'value3');
|
|
163
|
+
|
|
164
|
+
-- Create enum types in the dbml_test schema
|
|
165
|
+
CREATE TYPE dbml_test.enum_type1 AS ENUM ('value1', 'value2');
|
|
166
|
+
CREATE TYPE dbml_test.enum_type3 AS ENUM ('value4', 'value5');
|
|
167
|
+
|
|
168
|
+
-- Optionally, create tables to use these enum types
|
|
169
|
+
CREATE TABLE public.table1 (
|
|
170
|
+
id SERIAL PRIMARY KEY,
|
|
171
|
+
status public.enum_type1
|
|
172
|
+
);
|
|
173
|
+
|
|
174
|
+
CREATE TABLE public.table2 (
|
|
175
|
+
id SERIAL PRIMARY KEY,
|
|
176
|
+
status public.enum_type2
|
|
177
|
+
);
|
|
178
|
+
|
|
179
|
+
CREATE TABLE dbml_test.table1 (
|
|
180
|
+
id SERIAL PRIMARY KEY,
|
|
181
|
+
status dbml_test.enum_type1
|
|
182
|
+
);
|
|
183
|
+
|
|
184
|
+
CREATE TABLE dbml_test.table3 (
|
|
185
|
+
id SERIAL PRIMARY KEY,
|
|
186
|
+
status dbml_test.enum_type3
|
|
187
|
+
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dbml/cli",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@babel/cli": "^7.21.0",
|
|
29
|
-
"@dbml/connector": "^3.8.
|
|
30
|
-
"@dbml/core": "^3.8.
|
|
29
|
+
"@dbml/connector": "^3.8.1",
|
|
30
|
+
"@dbml/core": "^3.8.1",
|
|
31
31
|
"bluebird": "^3.5.5",
|
|
32
32
|
"chalk": "^2.4.2",
|
|
33
33
|
"commander": "^2.20.0",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"^.+\\.js$": "babel-jest"
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "40a25ded1488372f082739f6d43e45f2ad918e7e",
|
|
59
59
|
"engines": {
|
|
60
60
|
"node": ">=18"
|
|
61
61
|
}
|