@dbml/cli 3.2.0 → 3.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.
Files changed (69) hide show
  1. package/__test__/dbml2sql/filename --mysql --out-file/dbml-error.log +0 -36
  2. package/__test__/dbml2sql/filename --mysql --out-file/out-files/schema.sql +1 -1
  3. package/__test__/dbml2sql/filename --oracle --out-file/expect-out-files/schema.sql +57 -0
  4. package/__test__/dbml2sql/filename --oracle --out-file/in-files/schema.dbml +71 -0
  5. package/__test__/dbml2sql/filename --oracle --out-file/options.json +8 -0
  6. package/__test__/dbml2sql/filename --oracle --out-file/stdout.txt +1 -0
  7. package/__test__/dbml2sql/filename --oracle stdout/in-files/schema.dbml +71 -0
  8. package/__test__/dbml2sql/filename --oracle stdout/options.json +6 -0
  9. package/__test__/dbml2sql/filename --oracle stdout/stdout.txt +58 -0
  10. package/__test__/dbml2sql/filename --out-file/dbml-error.log +0 -36
  11. package/__test__/dbml2sql/filename --out-file/out-files/schema.sql +1 -1
  12. package/__test__/dbml2sql/filename --postgres --out-file/dbml-error.log +0 -24
  13. package/__test__/dbml2sql/filename --postgres --out-file/out-files/schema.sql +1 -1
  14. package/__test__/dbml2sql/filenames --mysql --out-file/dbml-error.log +0 -24
  15. package/__test__/dbml2sql/filenames --mysql --out-file/out-files/schema.sql +1 -1
  16. package/__test__/dbml2sql/filenames --oracle --out-file/expect-out-files/schema.sql +168 -0
  17. package/__test__/dbml2sql/filenames --oracle --out-file/in-files/business.dbml +40 -0
  18. package/__test__/dbml2sql/filenames --oracle --out-file/in-files/customer.dbml +39 -0
  19. package/__test__/dbml2sql/filenames --oracle --out-file/in-files/inventory.dbml +61 -0
  20. package/__test__/dbml2sql/filenames --oracle --out-file/options.json +10 -0
  21. package/__test__/dbml2sql/filenames --oracle --out-file/stdout.txt +1 -0
  22. package/__test__/dbml2sql/filenames --oracle stdout/in-files/business.dbml +40 -0
  23. package/__test__/dbml2sql/filenames --oracle stdout/in-files/customer.dbml +39 -0
  24. package/__test__/dbml2sql/filenames --oracle stdout/in-files/inventory.dbml +61 -0
  25. package/__test__/dbml2sql/filenames --oracle stdout/options.json +8 -0
  26. package/__test__/dbml2sql/filenames --oracle stdout/stdout.txt +171 -0
  27. package/__test__/dbml2sql/filenames --out-file/dbml-error.log +0 -24
  28. package/__test__/dbml2sql/filenames --out-file/out-files/schema.sql +1 -1
  29. package/__test__/dbml2sql/filenames --postgres --out-file/dbml-error.log +0 -24
  30. package/__test__/dbml2sql/filenames --postgres --out-file/out-files/schema.sql +1 -1
  31. package/__test__/dbml2sql/multiple_schema_mssql/dbml-error.log +0 -24
  32. package/__test__/dbml2sql/multiple_schema_mssql/out-files/multiple_schema.out.sql +1 -1
  33. package/__test__/dbml2sql/multiple_schema_mysql/dbml-error.log +0 -24
  34. package/__test__/dbml2sql/multiple_schema_mysql/out-files/multiple_schema.out.sql +1 -1
  35. package/__test__/dbml2sql/multiple_schema_oracle/expect-out-files/multiple_schema.out.sql +84 -0
  36. package/__test__/dbml2sql/multiple_schema_oracle/in-files/multiple_schema.in.dbml +45 -0
  37. package/__test__/dbml2sql/multiple_schema_oracle/options.json +8 -0
  38. package/__test__/dbml2sql/multiple_schema_oracle/stdout.txt +1 -0
  39. package/__test__/dbml2sql/multiple_schema_pg/dbml-error.log +0 -24
  40. package/__test__/dbml2sql/multiple_schema_pg/out-files/multiple_schema.out.sql +1 -1
  41. package/__test__/dbml2sql/syntax-error/dbml-error.log +1074 -2143
  42. package/__test__/sql2dbml/filename --mssql --out-file/dbml-error.log +0 -51
  43. package/__test__/sql2dbml/filename --mysql --out-file/dbml-error.log +0 -24
  44. package/__test__/sql2dbml/filename --out-file/dbml-error.log +0 -24
  45. package/__test__/sql2dbml/filename --postgres --out-file/dbml-error.log +0 -24
  46. package/__test__/sql2dbml/filenames --mysql --out-file/dbml-error.log +0 -239
  47. package/__test__/sql2dbml/filenames --mysql stdout/dbml-error.log +0 -218
  48. package/__test__/sql2dbml/filenames --out-file/dbml-error.log +0 -24
  49. package/__test__/sql2dbml/filenames --postgres --out-file/dbml-error.log +0 -24
  50. package/__test__/sql2dbml/multiple_schema_mssql/dbml-error.log +0 -121
  51. package/__test__/sql2dbml/multiple_schema_mysql/dbml-error.log +0 -104
  52. package/__test__/sql2dbml/multiple_schema_pg/dbml-error.log +32 -163
  53. package/__test__/sql2dbml/syntax-error/dbml-error.log +1092 -2694
  54. package/__test__/sql2dbml/syntax-error-duplicate-endpoints --mssql/dbml-error.log +1132 -1929
  55. package/__test__/sql2dbml/syntax-error-duplicate-endpoints --mysql/dbml-error.log +1127 -1924
  56. package/bin/dbml2sql.js +0 -0
  57. package/bin/sql2dbml.js +0 -0
  58. package/dbml-error.log +258 -322
  59. package/lib/cli/config.js +3 -0
  60. package/lib/cli/export.js +2 -1
  61. package/lib/cli/index.js +1 -1
  62. package/lib/cli/utils.js +1 -1
  63. package/package.json +3 -3
  64. package/src/cli/config.js +3 -0
  65. package/src/cli/export.js +7 -3
  66. package/src/cli/index.js +1 -0
  67. package/src/cli/utils.js +1 -1
  68. package/yarn-error.log +87 -0
  69. package/bin/dbml-error.log +0 -0
@@ -1,36 +0,0 @@
1
- 2021-07-13T12:37:40.734Z
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:47:15.905Z
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:56)
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
-
25
- 2021-07-13T12:58:20.418Z
26
- TypeError: Cannot read property 'tick' of undefined
27
- at exportHandler (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\src\cli\export.js:37:49)
28
- at dbml2sql (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\src\cli\index.js:19:3)
29
- at Object.<anonymous> (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\__test__\dbml2sql_bin.js:5:1)
30
- at Module._compile (internal/modules/cjs/loader.js:1085:14)
31
- at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
32
- at Module.load (internal/modules/cjs/loader.js:950:32)
33
- at Function.Module._load (internal/modules/cjs/loader.js:790:14)
34
- at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
35
- at internal/main/run_main_module.js:17:47
36
-
@@ -1,6 +1,6 @@
1
1
  -- SQL dump generated using DBML (dbml-lang.org)
2
2
  -- Database: MySQL
3
- -- Generated at: 2024-02-21T11:27:23.261Z
3
+ -- Generated at: 2024-03-19T03:39:26.465Z
4
4
 
5
5
  CREATE TABLE `orders` (
6
6
  `id` int PRIMARY KEY AUTO_INCREMENT,
@@ -0,0 +1,57 @@
1
+ CREATE TABLE "orders" (
2
+ "id" int GENERATED AS IDENTITY PRIMARY KEY,
3
+ "user_id" int UNIQUE NOT NULL,
4
+ "status" nvarchar2(255) NOT NULL CHECK ("status" IN ('created', 'running', 'done', 'failure'))
5
+ );
6
+
7
+ CREATE TABLE "order_items" (
8
+ "order_id" int,
9
+ "product_id" int,
10
+ "quantity" int DEFAULT 1
11
+ );
12
+
13
+ CREATE TABLE "products" (
14
+ "id" int PRIMARY KEY,
15
+ "name" nvarchar2(255),
16
+ "merchant_id" int NOT NULL,
17
+ "price" int,
18
+ "status" nvarchar2(255) NOT NULL CHECK ("status" IN ('Out of Stock', 'In Stock')),
19
+ "created_at" timestamp DEFAULT current_timestamp
20
+ );
21
+
22
+ CREATE TABLE "users" (
23
+ "id" int PRIMARY KEY,
24
+ "full_name" nvarchar2(255),
25
+ "email" nvarchar2(255) UNIQUE,
26
+ "gender" nvarchar2(255),
27
+ "date_of_birth" date,
28
+ "created_at" timestamp,
29
+ "country_code" int
30
+ );
31
+
32
+ CREATE TABLE "merchants" (
33
+ "id" int PRIMARY KEY,
34
+ "merchant_name" nvarchar2(255),
35
+ "country_code" int,
36
+ "created_at" timestamp,
37
+ "admin_id" int
38
+ );
39
+
40
+ CREATE TABLE "countries" (
41
+ "code" int PRIMARY KEY,
42
+ "name" nvarchar2(255)
43
+ );
44
+
45
+ CREATE INDEX "product_status" ON "products" ("merchant_id", "status");
46
+
47
+ ALTER TABLE "order_items" ADD FOREIGN KEY ("order_id") REFERENCES "orders" ("id");
48
+
49
+ ALTER TABLE "order_items" ADD FOREIGN KEY ("product_id") REFERENCES "products" ("id");
50
+
51
+ ALTER TABLE "users" ADD FOREIGN KEY ("country_code") REFERENCES "countries" ("code");
52
+
53
+ ALTER TABLE "merchants" ADD FOREIGN KEY ("country_code") REFERENCES "countries" ("code");
54
+
55
+ ALTER TABLE "products" ADD FOREIGN KEY ("merchant_id") REFERENCES "merchants" ("id");
56
+
57
+ ALTER TABLE "merchants" ADD FOREIGN KEY ("admin_id") REFERENCES "users" ("id");
@@ -0,0 +1,71 @@
1
+ Enum "orders_status" {
2
+ "created"
3
+ "running"
4
+ "done"
5
+ "failure"
6
+ }
7
+
8
+ Enum "product status" {
9
+ "Out of Stock"
10
+ "In Stock"
11
+ }
12
+
13
+ Table "orders" {
14
+ "id" int [pk, increment]
15
+ "user_id" int [unique, not null]
16
+ "status" orders_status
17
+ }
18
+
19
+ Table "order_items" {
20
+ "order_id" int
21
+ "product_id" int
22
+ "quantity" int [default: 1]
23
+ }
24
+
25
+ Table "products" {
26
+ "id" int [pk]
27
+ "name" nvarchar2(255)
28
+ "merchant_id" int [not null]
29
+ "price" int
30
+ "status" "product status"
31
+ "created_at" timestamp [default: `current_timestamp`]
32
+
33
+ Indexes {
34
+ (merchant_id, status) [name: "product_status"]
35
+ }
36
+ }
37
+
38
+ Table "users" {
39
+ "id" int [pk]
40
+ "full_name" nvarchar2(255)
41
+ "email" nvarchar2(255) [unique]
42
+ "gender" nvarchar2(255)
43
+ "date_of_birth" date
44
+ "created_at" timestamp
45
+ "country_code" int
46
+ }
47
+
48
+ Table "merchants" {
49
+ "id" int [pk]
50
+ "merchant_name" nvarchar2(255)
51
+ "country_code" int
52
+ "created_at" timestamp
53
+ "admin_id" int
54
+ }
55
+
56
+ Table "countries" {
57
+ "code" int [pk]
58
+ "name" nvarchar2(255)
59
+ }
60
+
61
+ Ref:"orders"."id" < "order_items"."order_id"
62
+
63
+ Ref:"products"."id" < "order_items"."product_id"
64
+
65
+ Ref:"countries"."code" < "users"."country_code"
66
+
67
+ Ref:"countries"."code" < "merchants"."country_code"
68
+
69
+ Ref:"merchants"."id" < "products"."merchant_id"
70
+
71
+ Ref:"users"."id" < "merchants"."admin_id"
@@ -0,0 +1,8 @@
1
+ {
2
+ "args": [
3
+ "./in-files/schema.dbml",
4
+ "--oracle",
5
+ "-o",
6
+ "./out-files/schema.sql"
7
+ ]
8
+ }
@@ -0,0 +1 @@
1
+ ✔ Generated SQL dump file (Oracle): schema.sql
@@ -0,0 +1,71 @@
1
+ Enum "orders_status" {
2
+ "created"
3
+ "running"
4
+ "done"
5
+ "failure"
6
+ }
7
+
8
+ Enum "product status" {
9
+ "Out of Stock"
10
+ "In Stock"
11
+ }
12
+
13
+ Table "orders" {
14
+ "id" int [pk, increment]
15
+ "user_id" int [unique, not null]
16
+ "status" orders_status
17
+ }
18
+
19
+ Table "order_items" {
20
+ "order_id" int
21
+ "product_id" int
22
+ "quantity" int [default: 1]
23
+ }
24
+
25
+ Table "products" {
26
+ "id" int [pk]
27
+ "name" nvarchar2(255)
28
+ "merchant_id" int [not null]
29
+ "price" int
30
+ "status" "product status"
31
+ "created_at" timestamp [default: `current_timestamp`]
32
+
33
+ Indexes {
34
+ (merchant_id, status) [name: "product_status"]
35
+ }
36
+ }
37
+
38
+ Table "users" {
39
+ "id" int [pk]
40
+ "full_name" nvarchar2(255)
41
+ "email" nvarchar2(255) [unique]
42
+ "gender" nvarchar2(255)
43
+ "date_of_birth" date
44
+ "created_at" timestamp
45
+ "country_code" int
46
+ }
47
+
48
+ Table "merchants" {
49
+ "id" int [pk]
50
+ "merchant_name" nvarchar2(255)
51
+ "country_code" int
52
+ "created_at" timestamp
53
+ "admin_id" int
54
+ }
55
+
56
+ Table "countries" {
57
+ "code" int [pk]
58
+ "name" nvarchar2(255)
59
+ }
60
+
61
+ Ref:"orders"."id" < "order_items"."order_id"
62
+
63
+ Ref:"products"."id" < "order_items"."product_id"
64
+
65
+ Ref:"countries"."code" < "users"."country_code"
66
+
67
+ Ref:"countries"."code" < "merchants"."country_code"
68
+
69
+ Ref:"merchants"."id" < "products"."merchant_id"
70
+
71
+ Ref:"users"."id" < "merchants"."admin_id"
@@ -0,0 +1,6 @@
1
+ {
2
+ "args": [
3
+ "./in-files/schema.dbml",
4
+ "--oracle"
5
+ ]
6
+ }
@@ -0,0 +1,58 @@
1
+ CREATE TABLE "orders" (
2
+ "id" int GENERATED AS IDENTITY PRIMARY KEY,
3
+ "user_id" int UNIQUE NOT NULL,
4
+ "status" nvarchar2(255) NOT NULL CHECK ("status" IN ('created', 'running', 'done', 'failure'))
5
+ );
6
+
7
+ CREATE TABLE "order_items" (
8
+ "order_id" int,
9
+ "product_id" int,
10
+ "quantity" int DEFAULT 1
11
+ );
12
+
13
+ CREATE TABLE "products" (
14
+ "id" int PRIMARY KEY,
15
+ "name" nvarchar2(255),
16
+ "merchant_id" int NOT NULL,
17
+ "price" int,
18
+ "status" nvarchar2(255) NOT NULL CHECK ("status" IN ('Out of Stock', 'In Stock')),
19
+ "created_at" timestamp DEFAULT current_timestamp
20
+ );
21
+
22
+ CREATE TABLE "users" (
23
+ "id" int PRIMARY KEY,
24
+ "full_name" nvarchar2(255),
25
+ "email" nvarchar2(255) UNIQUE,
26
+ "gender" nvarchar2(255),
27
+ "date_of_birth" date,
28
+ "created_at" timestamp,
29
+ "country_code" int
30
+ );
31
+
32
+ CREATE TABLE "merchants" (
33
+ "id" int PRIMARY KEY,
34
+ "merchant_name" nvarchar2(255),
35
+ "country_code" int,
36
+ "created_at" timestamp,
37
+ "admin_id" int
38
+ );
39
+
40
+ CREATE TABLE "countries" (
41
+ "code" int PRIMARY KEY,
42
+ "name" nvarchar2(255)
43
+ );
44
+
45
+ CREATE INDEX "product_status" ON "products" ("merchant_id", "status");
46
+
47
+ ALTER TABLE "order_items" ADD FOREIGN KEY ("order_id") REFERENCES "orders" ("id");
48
+
49
+ ALTER TABLE "order_items" ADD FOREIGN KEY ("product_id") REFERENCES "products" ("id");
50
+
51
+ ALTER TABLE "users" ADD FOREIGN KEY ("country_code") REFERENCES "countries" ("code");
52
+
53
+ ALTER TABLE "merchants" ADD FOREIGN KEY ("country_code") REFERENCES "countries" ("code");
54
+
55
+ ALTER TABLE "products" ADD FOREIGN KEY ("merchant_id") REFERENCES "merchants" ("id");
56
+
57
+ ALTER TABLE "merchants" ADD FOREIGN KEY ("admin_id") REFERENCES "users" ("id");
58
+
@@ -1,36 +0,0 @@
1
- 2021-07-13T12:37:43.283Z
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:47:19.039Z
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:56)
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
-
25
- 2021-07-13T12:58:22.994Z
26
- TypeError: Cannot read property 'tick' of undefined
27
- at exportHandler (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\src\cli\export.js:37:49)
28
- at dbml2sql (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\src\cli\index.js:19:3)
29
- at Object.<anonymous> (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\__test__\dbml2sql_bin.js:5:1)
30
- at Module._compile (internal/modules/cjs/loader.js:1085:14)
31
- at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
32
- at Module.load (internal/modules/cjs/loader.js:950:32)
33
- at Function.Module._load (internal/modules/cjs/loader.js:790:14)
34
- at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
35
- at internal/main/run_main_module.js:17:47
36
-
@@ -1,6 +1,6 @@
1
1
  -- SQL dump generated using DBML (dbml-lang.org)
2
2
  -- Database: PostgreSQL
3
- -- Generated at: 2024-02-21T11:27:24.192Z
3
+ -- Generated at: 2024-03-19T03:39:27.109Z
4
4
 
5
5
  CREATE TYPE "orders_status" AS ENUM (
6
6
  'created',
@@ -1,24 +0,0 @@
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
-
@@ -1,6 +1,6 @@
1
1
  -- SQL dump generated using DBML (dbml-lang.org)
2
2
  -- Database: PostgreSQL
3
- -- Generated at: 2024-02-21T11:27:24.652Z
3
+ -- Generated at: 2024-03-19T03:39:27.438Z
4
4
 
5
5
  CREATE TYPE "orders_status" AS ENUM (
6
6
  'created',
@@ -1,24 +0,0 @@
1
- 2021-07-13T12:37:47.900Z
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:26.936Z
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
-
@@ -1,6 +1,6 @@
1
1
  -- SQL dump generated using DBML (dbml-lang.org)
2
2
  -- Database: MySQL
3
- -- Generated at: 2024-02-21T11:27:26.063Z
3
+ -- Generated at: 2024-03-19T03:39:28.423Z
4
4
 
5
5
  CREATE TABLE `staff` (
6
6
  `id` int PRIMARY KEY,
@@ -0,0 +1,168 @@
1
+ CREATE TABLE "staff" (
2
+ "id" int PRIMARY KEY,
3
+ "first_name" nvarchar2(255),
4
+ "last_name" nvarchar2(255),
5
+ "address_id" int,
6
+ "picture" blob,
7
+ "email" nvarchar2(255),
8
+ "store_id" int,
9
+ "active" number(1),
10
+ "user_name" nvarchar2(255),
11
+ "password" nvarchar2(255),
12
+ "last_update" timestamp
13
+ );
14
+
15
+ CREATE TABLE "store" (
16
+ "id" int PRIMARY KEY,
17
+ "manager_staff_id" int,
18
+ "address_id" int,
19
+ "last_update" timestamp
20
+ );
21
+
22
+ CREATE TABLE "payment" (
23
+ "id" int PRIMARY KEY,
24
+ "customer_id" int,
25
+ "staff_id" int,
26
+ "rental_id" int,
27
+ "amount" float,
28
+ "payment_date" date,
29
+ "last_update" timestamp
30
+ );
31
+
32
+ CREATE TABLE "rental" (
33
+ "id" int PRIMARY KEY,
34
+ "rental_date" date,
35
+ "inventory_id" int,
36
+ "customer_id" int,
37
+ "return_date" date,
38
+ "staff_id" int,
39
+ "last_update" timestamp
40
+ );
41
+
42
+ ALTER TABLE "staff" ADD FOREIGN KEY ("store_id") REFERENCES "store" ("id");
43
+
44
+ ALTER TABLE "store" ADD FOREIGN KEY ("manager_staff_id") REFERENCES "staff" ("id");
45
+
46
+ ALTER TABLE "payment" ADD FOREIGN KEY ("staff_id") REFERENCES "staff" ("id");
47
+
48
+ ALTER TABLE "payment" ADD FOREIGN KEY ("rental_id") REFERENCES "rental" ("id");
49
+
50
+ ALTER TABLE "rental" ADD FOREIGN KEY ("staff_id") REFERENCES "staff" ("id");
51
+ CREATE TABLE "country" (
52
+ "id" int PRIMARY KEY,
53
+ "country" nvarchar2(255),
54
+ "last_update" timestamp
55
+ );
56
+
57
+ CREATE TABLE "city" (
58
+ "id" int PRIMARY KEY,
59
+ "city" nvarchar2(255),
60
+ "country_id" int,
61
+ "last_update" timestamp
62
+ );
63
+
64
+ CREATE TABLE "address" (
65
+ "id" int PRIMARY KEY,
66
+ "address" nvarchar2(255),
67
+ "address2" nvarchar2(255),
68
+ "district" nvarchar2(255),
69
+ "city_id" int,
70
+ "postal_code" nvarchar2(255),
71
+ "phone" nvarchar2(255),
72
+ "last_update" timestamp
73
+ );
74
+
75
+ CREATE TABLE "customer" (
76
+ "id" int PRIMARY KEY,
77
+ "store_id" int,
78
+ "first_name" nvarchar2(255),
79
+ "last_name" nvarchar2(255),
80
+ "email" nvarchar2(255),
81
+ "address_id" int,
82
+ "active" number(1),
83
+ "create_Date" timestamp,
84
+ "last_update" timestamp
85
+ );
86
+
87
+ CREATE INDEX "IDX_CUSTOMER" ON "customer" ("id", "first_name");
88
+
89
+ ALTER TABLE "city" ADD FOREIGN KEY ("country_id") REFERENCES "country" ("id");
90
+
91
+ ALTER TABLE "address" ADD FOREIGN KEY ("city_id") REFERENCES "city" ("id");
92
+
93
+ ALTER TABLE "customer" ADD FOREIGN KEY ("address_id") REFERENCES "address" ("id");
94
+ CREATE TABLE "category" (
95
+ "id" int PRIMARY KEY,
96
+ "name" nvarchar2(255),
97
+ "last_update" timestamp
98
+ );
99
+
100
+ CREATE TABLE "film_category" (
101
+ "id" int PRIMARY KEY,
102
+ "category_id" int,
103
+ "last_update" timestamp
104
+ );
105
+
106
+ CREATE TABLE "language" (
107
+ "id" int PRIMARY KEY,
108
+ "name" nvarchar2(255),
109
+ "last_update" timestamp
110
+ );
111
+
112
+ CREATE TABLE "film_text" (
113
+ "id" int PRIMARY KEY,
114
+ "film_id" int,
115
+ "title" nvarchar2(255),
116
+ "description" nclob
117
+ );
118
+
119
+ CREATE TABLE "actor" (
120
+ "id" int PRIMARY KEY,
121
+ "first_name" nvarchar2(255),
122
+ "last_name" nvarchar2(255),
123
+ "last_update" timestamp
124
+ );
125
+
126
+ CREATE TABLE "film" (
127
+ "id" int PRIMARY KEY,
128
+ "title" nvarchar2(255),
129
+ "description" nclob,
130
+ "releaase_year" int,
131
+ "language_id" int,
132
+ "original_language_id" int,
133
+ "rental_duration" int,
134
+ "rental_rate" float,
135
+ "length" int,
136
+ "replacement_cost" float,
137
+ "rating" nvarchar2(255),
138
+ "special_feature" nvarchar2(255),
139
+ "last_update" timestamp
140
+ );
141
+
142
+ CREATE TABLE "film_actor" (
143
+ "id" int PRIMARY KEY,
144
+ "film_id" int,
145
+ "actor_id" int,
146
+ "last_update" timestamp
147
+ );
148
+
149
+ CREATE TABLE "inventory" (
150
+ "id" int PRIMARY KEY,
151
+ "film_id" int,
152
+ "store_id" int,
153
+ "last_update" timestamp
154
+ );
155
+
156
+ ALTER TABLE "film_category" ADD FOREIGN KEY ("category_id") REFERENCES "category" ("id");
157
+
158
+ ALTER TABLE "film_text" ADD FOREIGN KEY ("film_id") REFERENCES "film" ("id");
159
+
160
+ ALTER TABLE "film" ADD FOREIGN KEY ("language_id") REFERENCES "language" ("id");
161
+
162
+ ALTER TABLE "film" ADD FOREIGN KEY ("original_language_id") REFERENCES "language" ("id");
163
+
164
+ ALTER TABLE "film_actor" ADD FOREIGN KEY ("film_id") REFERENCES "film" ("id");
165
+
166
+ ALTER TABLE "film_actor" ADD FOREIGN KEY ("actor_id") REFERENCES "actor" ("id");
167
+
168
+ ALTER TABLE "inventory" ADD FOREIGN KEY ("film_id") REFERENCES "film" ("id");
@@ -0,0 +1,40 @@
1
+ Table staff {
2
+ id int [pk]
3
+ first_name nvarchar2(255)
4
+ last_name nvarchar2(255)
5
+ address_id int
6
+ picture blob
7
+ email nvarchar2(255)
8
+ store_id int [ref: > store.id]
9
+ active number(1)
10
+ user_name nvarchar2(255)
11
+ password nvarchar2(255)
12
+ last_update timestamp
13
+ }
14
+
15
+ Table store {
16
+ id int [pk]
17
+ manager_staff_id int [ref: > staff.id]
18
+ address_id int
19
+ last_update timestamp
20
+ }
21
+
22
+ table payment {
23
+ id int [pk]
24
+ customer_id int
25
+ staff_id int [ref: > staff.id]
26
+ rental_id int [ref: > rental.id]
27
+ amount float
28
+ payment_date date
29
+ last_update timestamp
30
+ }
31
+
32
+ Table rental {
33
+ id int [pk]
34
+ rental_date date
35
+ inventory_id int
36
+ customer_id int
37
+ return_date date
38
+ staff_id int [ref: > staff.id]
39
+ last_update timestamp
40
+ }