@dbml/cli 2.3.1 → 2.4.0
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.
- package/__test__/cli.test.js +3 -1
- package/__test__/dbml2sql/filename --mysql --out-file/dbml-error.log +36 -0
- package/__test__/dbml2sql/filename --mysql --out-file/expect-out-files/schema.sql +4 -4
- package/__test__/dbml2sql/filename --mysql --out-file/out-files/schema.sql +65 -0
- package/__test__/dbml2sql/filename --mysql stdout/dbml-error.log +0 -0
- package/__test__/dbml2sql/filename --mysql stdout/stdout.txt +4 -4
- package/__test__/dbml2sql/filename --out-file/dbml-error.log +36 -0
- package/__test__/dbml2sql/filename --out-file/expect-out-files/schema.sql +4 -4
- package/__test__/dbml2sql/filename --out-file/out-files/schema.sql +77 -0
- package/__test__/dbml2sql/filename --postgres --out-file/dbml-error.log +24 -0
- package/__test__/dbml2sql/filename --postgres --out-file/expect-out-files/schema.sql +4 -4
- package/__test__/dbml2sql/filename --postgres --out-file/out-files/schema.sql +77 -0
- package/__test__/dbml2sql/filename --postgres stdout/dbml-error.log +0 -0
- package/__test__/dbml2sql/filename --postgres stdout/stdout.txt +4 -4
- package/__test__/dbml2sql/filename stdout/dbml-error.log +0 -0
- package/__test__/dbml2sql/filename stdout/stdout.txt +4 -4
- package/__test__/dbml2sql/filenames --mysql --out-file/dbml-error.log +24 -0
- package/__test__/dbml2sql/filenames --mysql --out-file/expect-out-files/schema.sql +2 -2
- package/__test__/dbml2sql/filenames --mysql --out-file/out-files/schema.sql +172 -0
- package/__test__/dbml2sql/filenames --mysql stdout/dbml-error.log +0 -0
- package/__test__/dbml2sql/filenames --mysql stdout/stdout.txt +2 -2
- package/__test__/dbml2sql/filenames --out-file/dbml-error.log +24 -0
- package/__test__/dbml2sql/filenames --out-file/expect-out-files/schema.sql +2 -2
- package/__test__/dbml2sql/filenames --out-file/out-files/schema.sql +172 -0
- package/__test__/dbml2sql/filenames --postgres --out-file/dbml-error.log +24 -0
- package/__test__/dbml2sql/filenames --postgres --out-file/expect-out-files/schema.sql +2 -2
- package/__test__/dbml2sql/filenames --postgres --out-file/out-files/schema.sql +172 -0
- package/__test__/dbml2sql/filenames --postgres stdout/dbml-error.log +0 -0
- package/__test__/dbml2sql/filenames --postgres stdout/stdout.txt +2 -2
- package/__test__/dbml2sql/filenames stdout/dbml-error.log +0 -0
- package/__test__/dbml2sql/filenames stdout/stdout.txt +2 -2
- package/__test__/dbml2sql/multiple_schema_mssql/dbml-error.log +24 -0
- package/__test__/dbml2sql/multiple_schema_mssql/expect-out-files/multiple_schema.out.sql +58 -0
- package/__test__/dbml2sql/multiple_schema_mssql/in-files/multiple_schema.in.dbml +62 -0
- package/__test__/dbml2sql/multiple_schema_mssql/options.json +8 -0
- package/__test__/dbml2sql/multiple_schema_mssql/out-files/multiple_schema.out.sql +62 -0
- package/__test__/dbml2sql/multiple_schema_mssql/stdout.txt +1 -0
- package/__test__/dbml2sql/multiple_schema_mysql/dbml-error.log +24 -0
- package/__test__/dbml2sql/multiple_schema_mysql/expect-out-files/multiple_schema.out.sql +46 -0
- package/__test__/dbml2sql/multiple_schema_mysql/in-files/multiple_schema.in.dbml +62 -0
- package/__test__/dbml2sql/multiple_schema_mysql/options.json +8 -0
- package/__test__/dbml2sql/multiple_schema_mysql/out-files/multiple_schema.out.sql +50 -0
- package/__test__/dbml2sql/multiple_schema_mysql/stdout.txt +1 -0
- package/__test__/dbml2sql/multiple_schema_pg/dbml-error.log +24 -0
- package/__test__/dbml2sql/multiple_schema_pg/expect-out-files/multiple_schema.out.sql +63 -0
- package/__test__/dbml2sql/multiple_schema_pg/in-files/multiple_schema.in.dbml +62 -0
- package/__test__/dbml2sql/multiple_schema_pg/options.json +8 -0
- package/__test__/dbml2sql/multiple_schema_pg/out-files/multiple_schema.out.sql +67 -0
- package/__test__/dbml2sql/multiple_schema_pg/stdout.txt +1 -0
- package/__test__/dbml2sql/syntax-error/dbml-error.log +1647 -0
- package/__test__/sql2dbml/filename --mssql --out-file/dbml-error.log +51 -0
- package/__test__/sql2dbml/filename --mssql --out-file/expect-out-files/schema.dbml +25 -0
- package/__test__/sql2dbml/filename --mssql --out-file/in-files/schema.sql +20 -0
- package/__test__/sql2dbml/filename --mssql --out-file/options.json +8 -0
- package/__test__/sql2dbml/filename --mssql --out-file/out-files/schema.dbml +25 -0
- package/__test__/sql2dbml/filename --mssql --out-file/stdout.txt +1 -0
- package/__test__/sql2dbml/filename --mysql --out-file/dbml-error.log +24 -0
- package/__test__/sql2dbml/filename --mysql --out-file/out-files/schema.dbml +74 -0
- package/__test__/sql2dbml/filename --mysql stdout/dbml-error.log +0 -0
- package/__test__/sql2dbml/filename --out-file/dbml-error.log +24 -0
- package/__test__/sql2dbml/filename --out-file/out-files/schema.dbml +74 -0
- package/__test__/sql2dbml/filename --postgres --out-file/dbml-error.log +24 -0
- package/__test__/sql2dbml/filename --postgres --out-file/out-files/schema.dbml +74 -0
- package/__test__/sql2dbml/filename --postgres stdout/dbml-error.log +0 -0
- package/__test__/sql2dbml/filename stdout/dbml-error.log +0 -0
- package/__test__/sql2dbml/filenames --mysql --out-file/dbml-error.log +24 -0
- package/__test__/sql2dbml/filenames --mysql --out-file/out-files/schema.dbml +170 -0
- package/__test__/sql2dbml/filenames --mysql stdout/dbml-error.log +0 -0
- package/__test__/sql2dbml/filenames --out-file/dbml-error.log +24 -0
- package/__test__/sql2dbml/filenames --out-file/out-files/schema.dbml +170 -0
- package/__test__/sql2dbml/filenames --postgres --out-file/dbml-error.log +24 -0
- package/__test__/sql2dbml/filenames --postgres --out-file/out-files/schema.dbml +170 -0
- package/__test__/sql2dbml/filenames --postgres stdout/dbml-error.log +0 -0
- package/__test__/sql2dbml/filenames stdout/dbml-error.log +0 -0
- package/__test__/sql2dbml/multiple_schema_mssql/dbml-error.log +104 -0
- package/__test__/sql2dbml/multiple_schema_mssql/expect-out-files/multiple_schema.out.dbml +103 -0
- package/__test__/sql2dbml/multiple_schema_mssql/in-files/multiple_schema.in.sql +71 -0
- package/__test__/sql2dbml/multiple_schema_mssql/options.json +8 -0
- package/__test__/sql2dbml/multiple_schema_mssql/out-files/multiple_schema.out.dbml +103 -0
- package/__test__/sql2dbml/multiple_schema_mssql/stdout.txt +1 -0
- package/__test__/sql2dbml/multiple_schema_mysql/dbml-error.log +104 -0
- package/__test__/sql2dbml/multiple_schema_mysql/expect-out-files/multiple_schema.out.dbml +91 -0
- package/__test__/sql2dbml/multiple_schema_mysql/in-files/multiple_schema.in.sql +48 -0
- package/__test__/sql2dbml/multiple_schema_mysql/options.json +8 -0
- package/__test__/sql2dbml/multiple_schema_mysql/out-files/multiple_schema.out.dbml +91 -0
- package/__test__/sql2dbml/multiple_schema_mysql/stdout.txt +1 -0
- package/__test__/sql2dbml/multiple_schema_pg/dbml-error.log +104 -0
- package/__test__/sql2dbml/multiple_schema_pg/expect-out-files/multiple_schema.out.dbml +68 -0
- package/__test__/sql2dbml/multiple_schema_pg/in-files/multiple_schema.in.sql +71 -0
- package/__test__/sql2dbml/multiple_schema_pg/options.json +8 -0
- package/__test__/sql2dbml/multiple_schema_pg/out-files/multiple_schema.out.dbml +68 -0
- package/__test__/sql2dbml/multiple_schema_pg/stdout.txt +1 -0
- package/__test__/sql2dbml/syntax-error/dbml-error.log +1620 -0
- package/bin/dbml2sql.js +0 -0
- package/bin/sql2dbml.js +0 -0
- package/dbml-error.log +980 -0
- package/lib/cli/export.js +1 -1
- package/lib/cli/import.js +1 -1
- package/lib/cli/index.js +1 -1
- package/package.json +4 -4
- package/src/cli/export.js +1 -1
- package/src/cli/import.js +1 -1
- package/src/cli/index.js +1 -0
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
-- SQL dump generated using DBML (dbml-lang.org)
|
|
2
|
+
-- Database: MySQL
|
|
3
|
+
-- Generated at: 2022-03-08T03:40:45.348Z
|
|
4
|
+
|
|
5
|
+
CREATE TABLE `staff` (
|
|
6
|
+
`id` int PRIMARY KEY,
|
|
7
|
+
`first_name` varchar(255),
|
|
8
|
+
`last_name` varchar(255),
|
|
9
|
+
`address_id` int,
|
|
10
|
+
`picture` blob,
|
|
11
|
+
`email` varchar(255),
|
|
12
|
+
`store_id` int,
|
|
13
|
+
`active` boolean,
|
|
14
|
+
`user_name` varchar(255),
|
|
15
|
+
`password` varchar(255),
|
|
16
|
+
`last_update` timestamp
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
CREATE TABLE `store` (
|
|
20
|
+
`id` int PRIMARY KEY,
|
|
21
|
+
`manager_staff_id` int,
|
|
22
|
+
`address_id` int,
|
|
23
|
+
`last_update` timestamp
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
CREATE TABLE `payment` (
|
|
27
|
+
`id` int PRIMARY KEY,
|
|
28
|
+
`customer_id` int,
|
|
29
|
+
`staff_id` int,
|
|
30
|
+
`rental_id` int,
|
|
31
|
+
`amount` decimal,
|
|
32
|
+
`payment_date` datetime,
|
|
33
|
+
`last_update` timestamp
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
CREATE TABLE `rental` (
|
|
37
|
+
`id` int PRIMARY KEY,
|
|
38
|
+
`rental_date` datetime,
|
|
39
|
+
`inventory_id` int,
|
|
40
|
+
`customer_id` int,
|
|
41
|
+
`return_date` ddatetime,
|
|
42
|
+
`staff_id` int,
|
|
43
|
+
`last_update` timestamp
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
ALTER TABLE `staff` ADD FOREIGN KEY (`store_id`) REFERENCES `store` (`id`);
|
|
47
|
+
|
|
48
|
+
ALTER TABLE `store` ADD FOREIGN KEY (`manager_staff_id`) REFERENCES `staff` (`id`);
|
|
49
|
+
|
|
50
|
+
ALTER TABLE `payment` ADD FOREIGN KEY (`staff_id`) REFERENCES `staff` (`id`);
|
|
51
|
+
|
|
52
|
+
ALTER TABLE `payment` ADD FOREIGN KEY (`rental_id`) REFERENCES `rental` (`id`);
|
|
53
|
+
|
|
54
|
+
ALTER TABLE `rental` ADD FOREIGN KEY (`staff_id`) REFERENCES `staff` (`id`);
|
|
55
|
+
CREATE TABLE `country` (
|
|
56
|
+
`id` int PRIMARY KEY,
|
|
57
|
+
`country` varchar(255),
|
|
58
|
+
`last_update` timestamp
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
CREATE TABLE `city` (
|
|
62
|
+
`id` int PRIMARY KEY,
|
|
63
|
+
`city` varchar(255),
|
|
64
|
+
`country_id` int,
|
|
65
|
+
`last_update` timestamp
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
CREATE TABLE `address` (
|
|
69
|
+
`id` int PRIMARY KEY,
|
|
70
|
+
`address` varchar(255),
|
|
71
|
+
`address2` varchar(255),
|
|
72
|
+
`district` varchar(255),
|
|
73
|
+
`city_id` int,
|
|
74
|
+
`postal_code` varchar(255),
|
|
75
|
+
`phone` varchar(255),
|
|
76
|
+
`last_update` timestamp
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
CREATE TABLE `customer` (
|
|
80
|
+
`id` int PRIMARY KEY,
|
|
81
|
+
`store_id` int,
|
|
82
|
+
`first_name` varchar(255),
|
|
83
|
+
`last_name` varchar(255),
|
|
84
|
+
`email` varchar(255),
|
|
85
|
+
`address_id` int,
|
|
86
|
+
`active` boolean,
|
|
87
|
+
`create_Date` timestamp,
|
|
88
|
+
`last_update` timestamp
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
CREATE INDEX `customer_index_0` ON `customer` (`id`, `first_name`) USING BTREE;
|
|
92
|
+
|
|
93
|
+
ALTER TABLE `city` ADD FOREIGN KEY (`country_id`) REFERENCES `country` (`id`);
|
|
94
|
+
|
|
95
|
+
ALTER TABLE `address` ADD FOREIGN KEY (`city_id`) REFERENCES `city` (`id`);
|
|
96
|
+
|
|
97
|
+
ALTER TABLE `customer` ADD FOREIGN KEY (`address_id`) REFERENCES `address` (`id`);
|
|
98
|
+
CREATE TABLE `category` (
|
|
99
|
+
`id` int PRIMARY KEY,
|
|
100
|
+
`name` varchar(255),
|
|
101
|
+
`last_update` timestamp
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
CREATE TABLE `film_category` (
|
|
105
|
+
`id` int PRIMARY KEY,
|
|
106
|
+
`category_id` int,
|
|
107
|
+
`last_update` timestamp
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
CREATE TABLE `language` (
|
|
111
|
+
`id` int PRIMARY KEY,
|
|
112
|
+
`name` varchar(255),
|
|
113
|
+
`last_update` timestamp
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
CREATE TABLE `film_text` (
|
|
117
|
+
`id` int PRIMARY KEY,
|
|
118
|
+
`film_id` int,
|
|
119
|
+
`title` varchar(255),
|
|
120
|
+
`description` text
|
|
121
|
+
);
|
|
122
|
+
|
|
123
|
+
CREATE TABLE `actor` (
|
|
124
|
+
`id` int PRIMARY KEY,
|
|
125
|
+
`first_name` varchar(255),
|
|
126
|
+
`last_name` varchar(255),
|
|
127
|
+
`last_update` timestamp
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
CREATE TABLE `film` (
|
|
131
|
+
`id` int PRIMARY KEY,
|
|
132
|
+
`title` varchar(255),
|
|
133
|
+
`description` text,
|
|
134
|
+
`releaase_year` int,
|
|
135
|
+
`language_id` int,
|
|
136
|
+
`original_language_id` int,
|
|
137
|
+
`rental_duration` int,
|
|
138
|
+
`rental_rate` decimal,
|
|
139
|
+
`length` int,
|
|
140
|
+
`replacement_cost` decimal,
|
|
141
|
+
`rating` varchar(255),
|
|
142
|
+
`special_feature` varchar(255),
|
|
143
|
+
`last_update` timestamp
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
CREATE TABLE `film_actor` (
|
|
147
|
+
`id` int PRIMARY KEY,
|
|
148
|
+
`film_id` int,
|
|
149
|
+
`actor_id` int,
|
|
150
|
+
`last_update` timestamp
|
|
151
|
+
);
|
|
152
|
+
|
|
153
|
+
CREATE TABLE `inventory` (
|
|
154
|
+
`id` int PRIMARY KEY,
|
|
155
|
+
`film_id` int,
|
|
156
|
+
`store_id` int,
|
|
157
|
+
`last_update` timestamp
|
|
158
|
+
);
|
|
159
|
+
|
|
160
|
+
ALTER TABLE `film_category` ADD FOREIGN KEY (`category_id`) REFERENCES `category` (`id`);
|
|
161
|
+
|
|
162
|
+
ALTER TABLE `film_text` ADD FOREIGN KEY (`film_id`) REFERENCES `inventory` (`film_id`);
|
|
163
|
+
|
|
164
|
+
ALTER TABLE `film` ADD FOREIGN KEY (`language_id`) REFERENCES `language` (`id`);
|
|
165
|
+
|
|
166
|
+
ALTER TABLE `film` ADD FOREIGN KEY (`original_language_id`) REFERENCES `language` (`id`);
|
|
167
|
+
|
|
168
|
+
ALTER TABLE `film_actor` ADD FOREIGN KEY (`film_id`) REFERENCES `film` (`id`);
|
|
169
|
+
|
|
170
|
+
ALTER TABLE `film_actor` ADD FOREIGN KEY (`actor_id`) REFERENCES `actor` (`id`);
|
|
171
|
+
|
|
172
|
+
ALTER TABLE `inventory` ADD FOREIGN KEY (`film_id`) REFERENCES `film` (`id`);
|
|
File without changes
|
|
@@ -85,14 +85,14 @@ CREATE TABLE `customer` (
|
|
|
85
85
|
`last_update` timestamp
|
|
86
86
|
);
|
|
87
87
|
|
|
88
|
+
CREATE INDEX `customer_index_0` ON `customer` (`id`, `first_name`) USING BTREE;
|
|
89
|
+
|
|
88
90
|
ALTER TABLE `city` ADD FOREIGN KEY (`country_id`) REFERENCES `country` (`id`);
|
|
89
91
|
|
|
90
92
|
ALTER TABLE `address` ADD FOREIGN KEY (`city_id`) REFERENCES `city` (`id`);
|
|
91
93
|
|
|
92
94
|
ALTER TABLE `customer` ADD FOREIGN KEY (`address_id`) REFERENCES `address` (`id`);
|
|
93
95
|
|
|
94
|
-
CREATE INDEX `customer_index_0` ON `customer` (`id`, `first_name`) USING BTREE;
|
|
95
|
-
|
|
96
96
|
CREATE TABLE `category` (
|
|
97
97
|
`id` int PRIMARY KEY,
|
|
98
98
|
`name` varchar(255),
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
2021-07-13T12:37:50.404Z
|
|
2
|
+
TypeError: Cannot read property 'tick' of undefined
|
|
3
|
+
at exportHandler (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\src\cli\export.js:37:56)
|
|
4
|
+
at dbml2sql (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\src\cli\index.js:19:3)
|
|
5
|
+
at Object.<anonymous> (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\__test__\dbml2sql_bin.js:5:1)
|
|
6
|
+
at Module._compile (internal/modules/cjs/loader.js:1085:14)
|
|
7
|
+
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
|
|
8
|
+
at Module.load (internal/modules/cjs/loader.js:950:32)
|
|
9
|
+
at Function.Module._load (internal/modules/cjs/loader.js:790:14)
|
|
10
|
+
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
|
|
11
|
+
at internal/main/run_main_module.js:17:47
|
|
12
|
+
|
|
13
|
+
2021-07-13T12:58:29.075Z
|
|
14
|
+
TypeError: Cannot read property 'tick' of undefined
|
|
15
|
+
at exportHandler (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\src\cli\export.js:37:49)
|
|
16
|
+
at dbml2sql (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\src\cli\index.js:19:3)
|
|
17
|
+
at Object.<anonymous> (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\__test__\dbml2sql_bin.js:5:1)
|
|
18
|
+
at Module._compile (internal/modules/cjs/loader.js:1085:14)
|
|
19
|
+
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
|
|
20
|
+
at Module.load (internal/modules/cjs/loader.js:950:32)
|
|
21
|
+
at Function.Module._load (internal/modules/cjs/loader.js:790:14)
|
|
22
|
+
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
|
|
23
|
+
at internal/main/run_main_module.js:17:47
|
|
24
|
+
|
|
@@ -84,13 +84,13 @@ CREATE TABLE "customer" (
|
|
|
84
84
|
"last_update" timestamp
|
|
85
85
|
);
|
|
86
86
|
|
|
87
|
+
CREATE INDEX ON "customer" USING BTREE ("id", "first_name");
|
|
88
|
+
|
|
87
89
|
ALTER TABLE "city" ADD FOREIGN KEY ("country_id") REFERENCES "country" ("id");
|
|
88
90
|
|
|
89
91
|
ALTER TABLE "address" ADD FOREIGN KEY ("city_id") REFERENCES "city" ("id");
|
|
90
92
|
|
|
91
93
|
ALTER TABLE "customer" ADD FOREIGN KEY ("address_id") REFERENCES "address" ("id");
|
|
92
|
-
|
|
93
|
-
CREATE INDEX ON "customer" USING BTREE ("id", "first_name");
|
|
94
94
|
CREATE TABLE "category" (
|
|
95
95
|
"id" int PRIMARY KEY,
|
|
96
96
|
"name" varchar,
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
-- SQL dump generated using DBML (dbml-lang.org)
|
|
2
|
+
-- Database: PostgreSQL
|
|
3
|
+
-- Generated at: 2022-03-08T03:40:51.012Z
|
|
4
|
+
|
|
5
|
+
CREATE TABLE "staff" (
|
|
6
|
+
"id" int PRIMARY KEY,
|
|
7
|
+
"first_name" varchar,
|
|
8
|
+
"last_name" varchar,
|
|
9
|
+
"address_id" int,
|
|
10
|
+
"picture" blob,
|
|
11
|
+
"email" varchar,
|
|
12
|
+
"store_id" int,
|
|
13
|
+
"active" boolean,
|
|
14
|
+
"user_name" varchar,
|
|
15
|
+
"password" varchar,
|
|
16
|
+
"last_update" timestamp
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
CREATE TABLE "store" (
|
|
20
|
+
"id" int PRIMARY KEY,
|
|
21
|
+
"manager_staff_id" int,
|
|
22
|
+
"address_id" int,
|
|
23
|
+
"last_update" timestamp
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
CREATE TABLE "payment" (
|
|
27
|
+
"id" int PRIMARY KEY,
|
|
28
|
+
"customer_id" int,
|
|
29
|
+
"staff_id" int,
|
|
30
|
+
"rental_id" int,
|
|
31
|
+
"amount" decimal,
|
|
32
|
+
"payment_date" datetime,
|
|
33
|
+
"last_update" timestamp
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
CREATE TABLE "rental" (
|
|
37
|
+
"id" int PRIMARY KEY,
|
|
38
|
+
"rental_date" datetime,
|
|
39
|
+
"inventory_id" int,
|
|
40
|
+
"customer_id" int,
|
|
41
|
+
"return_date" ddatetime,
|
|
42
|
+
"staff_id" int,
|
|
43
|
+
"last_update" timestamp
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
ALTER TABLE "staff" ADD FOREIGN KEY ("store_id") REFERENCES "store" ("id");
|
|
47
|
+
|
|
48
|
+
ALTER TABLE "store" ADD FOREIGN KEY ("manager_staff_id") REFERENCES "staff" ("id");
|
|
49
|
+
|
|
50
|
+
ALTER TABLE "payment" ADD FOREIGN KEY ("staff_id") REFERENCES "staff" ("id");
|
|
51
|
+
|
|
52
|
+
ALTER TABLE "payment" ADD FOREIGN KEY ("rental_id") REFERENCES "rental" ("id");
|
|
53
|
+
|
|
54
|
+
ALTER TABLE "rental" ADD FOREIGN KEY ("staff_id") REFERENCES "staff" ("id");
|
|
55
|
+
CREATE TABLE "country" (
|
|
56
|
+
"id" int PRIMARY KEY,
|
|
57
|
+
"country" varchar,
|
|
58
|
+
"last_update" timestamp
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
CREATE TABLE "city" (
|
|
62
|
+
"id" int PRIMARY KEY,
|
|
63
|
+
"city" varchar,
|
|
64
|
+
"country_id" int,
|
|
65
|
+
"last_update" timestamp
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
CREATE TABLE "address" (
|
|
69
|
+
"id" int PRIMARY KEY,
|
|
70
|
+
"address" varchar,
|
|
71
|
+
"address2" varchar,
|
|
72
|
+
"district" varchar,
|
|
73
|
+
"city_id" int,
|
|
74
|
+
"postal_code" varchar,
|
|
75
|
+
"phone" varchar,
|
|
76
|
+
"last_update" timestamp
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
CREATE TABLE "customer" (
|
|
80
|
+
"id" int PRIMARY KEY,
|
|
81
|
+
"store_id" int,
|
|
82
|
+
"first_name" varchar,
|
|
83
|
+
"last_name" varchar,
|
|
84
|
+
"email" varchar,
|
|
85
|
+
"address_id" int,
|
|
86
|
+
"active" boolean,
|
|
87
|
+
"create_Date" timestamp,
|
|
88
|
+
"last_update" timestamp
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
CREATE INDEX ON "customer" USING BTREE ("id", "first_name");
|
|
92
|
+
|
|
93
|
+
ALTER TABLE "city" ADD FOREIGN KEY ("country_id") REFERENCES "country" ("id");
|
|
94
|
+
|
|
95
|
+
ALTER TABLE "address" ADD FOREIGN KEY ("city_id") REFERENCES "city" ("id");
|
|
96
|
+
|
|
97
|
+
ALTER TABLE "customer" ADD FOREIGN KEY ("address_id") REFERENCES "address" ("id");
|
|
98
|
+
CREATE TABLE "category" (
|
|
99
|
+
"id" int PRIMARY KEY,
|
|
100
|
+
"name" varchar,
|
|
101
|
+
"last_update" timestamp
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
CREATE TABLE "film_category" (
|
|
105
|
+
"id" int PRIMARY KEY,
|
|
106
|
+
"category_id" int,
|
|
107
|
+
"last_update" timestamp
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
CREATE TABLE "language" (
|
|
111
|
+
"id" int PRIMARY KEY,
|
|
112
|
+
"name" varchar,
|
|
113
|
+
"last_update" timestamp
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
CREATE TABLE "film_text" (
|
|
117
|
+
"id" int PRIMARY KEY,
|
|
118
|
+
"film_id" int,
|
|
119
|
+
"title" varchar,
|
|
120
|
+
"description" text
|
|
121
|
+
);
|
|
122
|
+
|
|
123
|
+
CREATE TABLE "actor" (
|
|
124
|
+
"id" int PRIMARY KEY,
|
|
125
|
+
"first_name" varchar,
|
|
126
|
+
"last_name" varchar,
|
|
127
|
+
"last_update" timestamp
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
CREATE TABLE "film" (
|
|
131
|
+
"id" int PRIMARY KEY,
|
|
132
|
+
"title" varchar,
|
|
133
|
+
"description" text,
|
|
134
|
+
"releaase_year" int,
|
|
135
|
+
"language_id" int,
|
|
136
|
+
"original_language_id" int,
|
|
137
|
+
"rental_duration" int,
|
|
138
|
+
"rental_rate" decimal,
|
|
139
|
+
"length" int,
|
|
140
|
+
"replacement_cost" decimal,
|
|
141
|
+
"rating" varchar,
|
|
142
|
+
"special_feature" varchar,
|
|
143
|
+
"last_update" timestamp
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
CREATE TABLE "film_actor" (
|
|
147
|
+
"id" int PRIMARY KEY,
|
|
148
|
+
"film_id" int,
|
|
149
|
+
"actor_id" int,
|
|
150
|
+
"last_update" timestamp
|
|
151
|
+
);
|
|
152
|
+
|
|
153
|
+
CREATE TABLE "inventory" (
|
|
154
|
+
"id" int PRIMARY KEY,
|
|
155
|
+
"film_id" int,
|
|
156
|
+
"store_id" int,
|
|
157
|
+
"last_update" timestamp
|
|
158
|
+
);
|
|
159
|
+
|
|
160
|
+
ALTER TABLE "film_category" ADD FOREIGN KEY ("category_id") REFERENCES "category" ("id");
|
|
161
|
+
|
|
162
|
+
ALTER TABLE "film_text" ADD FOREIGN KEY ("film_id") REFERENCES "inventory" ("film_id");
|
|
163
|
+
|
|
164
|
+
ALTER TABLE "film" ADD FOREIGN KEY ("language_id") REFERENCES "language" ("id");
|
|
165
|
+
|
|
166
|
+
ALTER TABLE "film" ADD FOREIGN KEY ("original_language_id") REFERENCES "language" ("id");
|
|
167
|
+
|
|
168
|
+
ALTER TABLE "film_actor" ADD FOREIGN KEY ("film_id") REFERENCES "film" ("id");
|
|
169
|
+
|
|
170
|
+
ALTER TABLE "film_actor" ADD FOREIGN KEY ("actor_id") REFERENCES "actor" ("id");
|
|
171
|
+
|
|
172
|
+
ALTER TABLE "inventory" ADD FOREIGN KEY ("film_id") REFERENCES "film" ("id");
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
2021-07-13T12:37:51.477Z
|
|
2
|
+
TypeError: Cannot read property 'tick' of undefined
|
|
3
|
+
at exportHandler (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\src\cli\export.js:37:56)
|
|
4
|
+
at dbml2sql (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\src\cli\index.js:19:3)
|
|
5
|
+
at Object.<anonymous> (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\__test__\dbml2sql_bin.js:5:1)
|
|
6
|
+
at Module._compile (internal/modules/cjs/loader.js:1085:14)
|
|
7
|
+
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
|
|
8
|
+
at Module.load (internal/modules/cjs/loader.js:950:32)
|
|
9
|
+
at Function.Module._load (internal/modules/cjs/loader.js:790:14)
|
|
10
|
+
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
|
|
11
|
+
at internal/main/run_main_module.js:17:47
|
|
12
|
+
|
|
13
|
+
2021-07-13T12:58:30.073Z
|
|
14
|
+
TypeError: Cannot read property 'tick' of undefined
|
|
15
|
+
at exportHandler (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\src\cli\export.js:37:49)
|
|
16
|
+
at dbml2sql (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\src\cli\index.js:19:3)
|
|
17
|
+
at Object.<anonymous> (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\__test__\dbml2sql_bin.js:5:1)
|
|
18
|
+
at Module._compile (internal/modules/cjs/loader.js:1085:14)
|
|
19
|
+
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
|
|
20
|
+
at Module.load (internal/modules/cjs/loader.js:950:32)
|
|
21
|
+
at Function.Module._load (internal/modules/cjs/loader.js:790:14)
|
|
22
|
+
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
|
|
23
|
+
at internal/main/run_main_module.js:17:47
|
|
24
|
+
|
|
@@ -84,13 +84,13 @@ CREATE TABLE "customer" (
|
|
|
84
84
|
"last_update" timestamp
|
|
85
85
|
);
|
|
86
86
|
|
|
87
|
+
CREATE INDEX ON "customer" USING BTREE ("id", "first_name");
|
|
88
|
+
|
|
87
89
|
ALTER TABLE "city" ADD FOREIGN KEY ("country_id") REFERENCES "country" ("id");
|
|
88
90
|
|
|
89
91
|
ALTER TABLE "address" ADD FOREIGN KEY ("city_id") REFERENCES "city" ("id");
|
|
90
92
|
|
|
91
93
|
ALTER TABLE "customer" ADD FOREIGN KEY ("address_id") REFERENCES "address" ("id");
|
|
92
|
-
|
|
93
|
-
CREATE INDEX ON "customer" USING BTREE ("id", "first_name");
|
|
94
94
|
CREATE TABLE "category" (
|
|
95
95
|
"id" int PRIMARY KEY,
|
|
96
96
|
"name" varchar,
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
-- SQL dump generated using DBML (dbml-lang.org)
|
|
2
|
+
-- Database: PostgreSQL
|
|
3
|
+
-- Generated at: 2022-03-08T03:40:53.105Z
|
|
4
|
+
|
|
5
|
+
CREATE TABLE "staff" (
|
|
6
|
+
"id" int PRIMARY KEY,
|
|
7
|
+
"first_name" varchar,
|
|
8
|
+
"last_name" varchar,
|
|
9
|
+
"address_id" int,
|
|
10
|
+
"picture" blob,
|
|
11
|
+
"email" varchar,
|
|
12
|
+
"store_id" int,
|
|
13
|
+
"active" boolean,
|
|
14
|
+
"user_name" varchar,
|
|
15
|
+
"password" varchar,
|
|
16
|
+
"last_update" timestamp
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
CREATE TABLE "store" (
|
|
20
|
+
"id" int PRIMARY KEY,
|
|
21
|
+
"manager_staff_id" int,
|
|
22
|
+
"address_id" int,
|
|
23
|
+
"last_update" timestamp
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
CREATE TABLE "payment" (
|
|
27
|
+
"id" int PRIMARY KEY,
|
|
28
|
+
"customer_id" int,
|
|
29
|
+
"staff_id" int,
|
|
30
|
+
"rental_id" int,
|
|
31
|
+
"amount" decimal,
|
|
32
|
+
"payment_date" datetime,
|
|
33
|
+
"last_update" timestamp
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
CREATE TABLE "rental" (
|
|
37
|
+
"id" int PRIMARY KEY,
|
|
38
|
+
"rental_date" datetime,
|
|
39
|
+
"inventory_id" int,
|
|
40
|
+
"customer_id" int,
|
|
41
|
+
"return_date" ddatetime,
|
|
42
|
+
"staff_id" int,
|
|
43
|
+
"last_update" timestamp
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
ALTER TABLE "staff" ADD FOREIGN KEY ("store_id") REFERENCES "store" ("id");
|
|
47
|
+
|
|
48
|
+
ALTER TABLE "store" ADD FOREIGN KEY ("manager_staff_id") REFERENCES "staff" ("id");
|
|
49
|
+
|
|
50
|
+
ALTER TABLE "payment" ADD FOREIGN KEY ("staff_id") REFERENCES "staff" ("id");
|
|
51
|
+
|
|
52
|
+
ALTER TABLE "payment" ADD FOREIGN KEY ("rental_id") REFERENCES "rental" ("id");
|
|
53
|
+
|
|
54
|
+
ALTER TABLE "rental" ADD FOREIGN KEY ("staff_id") REFERENCES "staff" ("id");
|
|
55
|
+
CREATE TABLE "country" (
|
|
56
|
+
"id" int PRIMARY KEY,
|
|
57
|
+
"country" varchar,
|
|
58
|
+
"last_update" timestamp
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
CREATE TABLE "city" (
|
|
62
|
+
"id" int PRIMARY KEY,
|
|
63
|
+
"city" varchar,
|
|
64
|
+
"country_id" int,
|
|
65
|
+
"last_update" timestamp
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
CREATE TABLE "address" (
|
|
69
|
+
"id" int PRIMARY KEY,
|
|
70
|
+
"address" varchar,
|
|
71
|
+
"address2" varchar,
|
|
72
|
+
"district" varchar,
|
|
73
|
+
"city_id" int,
|
|
74
|
+
"postal_code" varchar,
|
|
75
|
+
"phone" varchar,
|
|
76
|
+
"last_update" timestamp
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
CREATE TABLE "customer" (
|
|
80
|
+
"id" int PRIMARY KEY,
|
|
81
|
+
"store_id" int,
|
|
82
|
+
"first_name" varchar,
|
|
83
|
+
"last_name" varchar,
|
|
84
|
+
"email" varchar,
|
|
85
|
+
"address_id" int,
|
|
86
|
+
"active" boolean,
|
|
87
|
+
"create_Date" timestamp,
|
|
88
|
+
"last_update" timestamp
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
CREATE INDEX ON "customer" USING BTREE ("id", "first_name");
|
|
92
|
+
|
|
93
|
+
ALTER TABLE "city" ADD FOREIGN KEY ("country_id") REFERENCES "country" ("id");
|
|
94
|
+
|
|
95
|
+
ALTER TABLE "address" ADD FOREIGN KEY ("city_id") REFERENCES "city" ("id");
|
|
96
|
+
|
|
97
|
+
ALTER TABLE "customer" ADD FOREIGN KEY ("address_id") REFERENCES "address" ("id");
|
|
98
|
+
CREATE TABLE "category" (
|
|
99
|
+
"id" int PRIMARY KEY,
|
|
100
|
+
"name" varchar,
|
|
101
|
+
"last_update" timestamp
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
CREATE TABLE "film_category" (
|
|
105
|
+
"id" int PRIMARY KEY,
|
|
106
|
+
"category_id" int,
|
|
107
|
+
"last_update" timestamp
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
CREATE TABLE "language" (
|
|
111
|
+
"id" int PRIMARY KEY,
|
|
112
|
+
"name" varchar,
|
|
113
|
+
"last_update" timestamp
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
CREATE TABLE "film_text" (
|
|
117
|
+
"id" int PRIMARY KEY,
|
|
118
|
+
"film_id" int,
|
|
119
|
+
"title" varchar,
|
|
120
|
+
"description" text
|
|
121
|
+
);
|
|
122
|
+
|
|
123
|
+
CREATE TABLE "actor" (
|
|
124
|
+
"id" int PRIMARY KEY,
|
|
125
|
+
"first_name" varchar,
|
|
126
|
+
"last_name" varchar,
|
|
127
|
+
"last_update" timestamp
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
CREATE TABLE "film" (
|
|
131
|
+
"id" int PRIMARY KEY,
|
|
132
|
+
"title" varchar,
|
|
133
|
+
"description" text,
|
|
134
|
+
"releaase_year" int,
|
|
135
|
+
"language_id" int,
|
|
136
|
+
"original_language_id" int,
|
|
137
|
+
"rental_duration" int,
|
|
138
|
+
"rental_rate" decimal,
|
|
139
|
+
"length" int,
|
|
140
|
+
"replacement_cost" decimal,
|
|
141
|
+
"rating" varchar,
|
|
142
|
+
"special_feature" varchar,
|
|
143
|
+
"last_update" timestamp
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
CREATE TABLE "film_actor" (
|
|
147
|
+
"id" int PRIMARY KEY,
|
|
148
|
+
"film_id" int,
|
|
149
|
+
"actor_id" int,
|
|
150
|
+
"last_update" timestamp
|
|
151
|
+
);
|
|
152
|
+
|
|
153
|
+
CREATE TABLE "inventory" (
|
|
154
|
+
"id" int PRIMARY KEY,
|
|
155
|
+
"film_id" int,
|
|
156
|
+
"store_id" int,
|
|
157
|
+
"last_update" timestamp
|
|
158
|
+
);
|
|
159
|
+
|
|
160
|
+
ALTER TABLE "film_category" ADD FOREIGN KEY ("category_id") REFERENCES "category" ("id");
|
|
161
|
+
|
|
162
|
+
ALTER TABLE "film_text" ADD FOREIGN KEY ("film_id") REFERENCES "inventory" ("film_id");
|
|
163
|
+
|
|
164
|
+
ALTER TABLE "film" ADD FOREIGN KEY ("language_id") REFERENCES "language" ("id");
|
|
165
|
+
|
|
166
|
+
ALTER TABLE "film" ADD FOREIGN KEY ("original_language_id") REFERENCES "language" ("id");
|
|
167
|
+
|
|
168
|
+
ALTER TABLE "film_actor" ADD FOREIGN KEY ("film_id") REFERENCES "film" ("id");
|
|
169
|
+
|
|
170
|
+
ALTER TABLE "film_actor" ADD FOREIGN KEY ("actor_id") REFERENCES "actor" ("id");
|
|
171
|
+
|
|
172
|
+
ALTER TABLE "inventory" ADD FOREIGN KEY ("film_id") REFERENCES "film" ("id");
|
|
File without changes
|
|
@@ -85,14 +85,14 @@ CREATE TABLE "customer" (
|
|
|
85
85
|
"last_update" timestamp
|
|
86
86
|
);
|
|
87
87
|
|
|
88
|
+
CREATE INDEX ON "customer" USING BTREE ("id", "first_name");
|
|
89
|
+
|
|
88
90
|
ALTER TABLE "city" ADD FOREIGN KEY ("country_id") REFERENCES "country" ("id");
|
|
89
91
|
|
|
90
92
|
ALTER TABLE "address" ADD FOREIGN KEY ("city_id") REFERENCES "city" ("id");
|
|
91
93
|
|
|
92
94
|
ALTER TABLE "customer" ADD FOREIGN KEY ("address_id") REFERENCES "address" ("id");
|
|
93
95
|
|
|
94
|
-
CREATE INDEX ON "customer" USING BTREE ("id", "first_name");
|
|
95
|
-
|
|
96
96
|
CREATE TABLE "category" (
|
|
97
97
|
"id" int PRIMARY KEY,
|
|
98
98
|
"name" varchar,
|
|
File without changes
|
|
@@ -85,14 +85,14 @@ CREATE TABLE "customer" (
|
|
|
85
85
|
"last_update" timestamp
|
|
86
86
|
);
|
|
87
87
|
|
|
88
|
+
CREATE INDEX ON "customer" USING BTREE ("id", "first_name");
|
|
89
|
+
|
|
88
90
|
ALTER TABLE "city" ADD FOREIGN KEY ("country_id") REFERENCES "country" ("id");
|
|
89
91
|
|
|
90
92
|
ALTER TABLE "address" ADD FOREIGN KEY ("city_id") REFERENCES "city" ("id");
|
|
91
93
|
|
|
92
94
|
ALTER TABLE "customer" ADD FOREIGN KEY ("address_id") REFERENCES "address" ("id");
|
|
93
95
|
|
|
94
|
-
CREATE INDEX ON "customer" USING BTREE ("id", "first_name");
|
|
95
|
-
|
|
96
96
|
CREATE TABLE "category" (
|
|
97
97
|
"id" int PRIMARY KEY,
|
|
98
98
|
"name" varchar,
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
2021-07-13T12:37:44.406Z
|
|
2
|
+
TypeError: Cannot read property 'tick' of undefined
|
|
3
|
+
at exportHandler (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\src\cli\export.js:37:56)
|
|
4
|
+
at dbml2sql (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\src\cli\index.js:19:3)
|
|
5
|
+
at Object.<anonymous> (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\__test__\dbml2sql_bin.js:5:1)
|
|
6
|
+
at Module._compile (internal/modules/cjs/loader.js:1085:14)
|
|
7
|
+
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
|
|
8
|
+
at Module.load (internal/modules/cjs/loader.js:950:32)
|
|
9
|
+
at Function.Module._load (internal/modules/cjs/loader.js:790:14)
|
|
10
|
+
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
|
|
11
|
+
at internal/main/run_main_module.js:17:47
|
|
12
|
+
|
|
13
|
+
2021-07-13T12:58:23.999Z
|
|
14
|
+
TypeError: Cannot read property 'tick' of undefined
|
|
15
|
+
at exportHandler (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\src\cli\export.js:37:49)
|
|
16
|
+
at dbml2sql (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\src\cli\index.js:19:3)
|
|
17
|
+
at Object.<anonymous> (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\__test__\dbml2sql_bin.js:5:1)
|
|
18
|
+
at Module._compile (internal/modules/cjs/loader.js:1085:14)
|
|
19
|
+
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
|
|
20
|
+
at Module.load (internal/modules/cjs/loader.js:950:32)
|
|
21
|
+
at Function.Module._load (internal/modules/cjs/loader.js:790:14)
|
|
22
|
+
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
|
|
23
|
+
at internal/main/run_main_module.js:17:47
|
|
24
|
+
|