diff --git a/README.md b/README.md index 2258fa4..57465f3 100644 --- a/README.md +++ b/README.md @@ -28,10 +28,6 @@ create database "express-admin-examples"; -- create schema 'name'; (default: 'public') create user liolio with password 'karamba'; grant all on database "express-admin-examples" to liolio; --- public schema by default -grant all on schema "public" to liolio; -grant all on all tables in schema "public" to liolio; -grant all on all sequences in schema "public" to liolio; ``` @@ -41,9 +37,14 @@ grant all on all sequences in schema "public" to liolio; # MySQL $ mysql -p --user=root 'express-admin-examples' < fixtures/mysql/schema.sql $ mysql -p --user=root 'express-admin-examples' < fixtures/mysql/insert.sql + # PostgreSQL $ sudo -u postgres psql 'express-admin-examples' < fixtures/pg/schema.sql $ sudo -u postgres psql 'express-admin-examples' < fixtures/pg/insert.sql +# ... on Windows +> psql -U postgres express-admin-examples < fixtures/pg/schema.sql +> psql -U postgres express-admin-examples < fixtures/pg/insert.sql + # SQLite $ node fixtures/sqlite/import.js ``` @@ -53,8 +54,14 @@ For SQLite you need to change the path to the database inside `config/sqlite/con ```bash # MySQL $ admin config/mysql/ + # PostgreSQL $ admin config/pg/ +# ... locally installed, on Linux +$ ./node_modules/.bin/admin config/pg +# ... locally installed, on Windows +> node_modules\.bin\admin config/pg + # SQLite $ admin config/sqlite/ ``` diff --git a/config/mysql/custom.json b/config/mysql/custom.json index fa0e46c..1b14e1f 100644 --- a/config/mysql/custom.json +++ b/config/mysql/custom.json @@ -1,7 +1,7 @@ { "editors": { "app": { - "path": "/home/mighty/node/modules/express-admin-examples/config/custom/editors/app.js", + "path": "/home/revlin/Projects/maponics-source/express-admin-examples/config/custom/editors/app.js", "slug": "upload" }, "public": { @@ -11,7 +11,7 @@ ] }, "local": { - "path": "/home/mighty/node/modules/express-admin-examples/config/custom/editors", + "path": "/home/revlin/Projects/maponics-source/express-admin-examples/config/custom/editors", "js": [ "/jslib/tinymce/js/tinymce/tinymce.min.js", "/jslib/tinymce/js/tinymce/jquery.tinymce.min.js", @@ -22,7 +22,7 @@ }, "view1": { "app": { - "path": "/home/mighty/node/modules/express-admin-examples/config/custom/app1/app.js", + "path": "/home/revlin/Projects/maponics-source/express-admin-examples/config/custom/app1/app.js", "slug": "view1", "verbose": "Simple", "mainview": { @@ -32,7 +32,7 @@ }, "view2": { "app": { - "path" : "/home/mighty/node/modules/express-admin-examples/config/custom/app2/app.js", + "path" : "/home/revlin/Projects/maponics-source/express-admin-examples/config/custom/app2/app.js", "slug": "view2", "verbose": "Custom global static files", "mainview": { @@ -41,7 +41,7 @@ }, "public": { "local": { - "path": "/home/mighty/node/modules/express-admin-examples/config/custom/app2/public", + "path": "/home/revlin/Projects/maponics-source/express-admin-examples/config/custom/app2/public", "css": [ "/css/global.css" ], @@ -53,7 +53,7 @@ }, "view3": { "app": { - "path" : "/home/mighty/node/modules/express-admin-examples/config/custom/app3/app.js", + "path" : "/home/revlin/Projects/maponics-source/express-admin-examples/config/custom/app3/app.js", "slug": "view3", "verbose": "Custom local static files", "mainview": { @@ -62,13 +62,13 @@ }, "public": { "local": { - "path": "/home/mighty/node/modules/express-admin-examples/config/custom/app3/public" + "path": "/home/revlin/Projects/maponics-source/express-admin-examples/config/custom/app3/public" } } }, "view4": { "app": { - "path" : "/home/mighty/node/modules/express-admin-examples/config/custom/app4/app.js", + "path" : "/home/revlin/Projects/maponics-source/express-admin-examples/config/custom/app4/app.js", "slug": "view4", "verbose": "Breadcrumbs", "mainview": { @@ -78,7 +78,7 @@ }, "stats": { "app": { - "path" : "/home/mighty/node/modules/express-admin-examples/config/custom/highcharts/app.js", + "path" : "/home/revlin/Projects/maponics-source/express-admin-examples/config/custom/highcharts/app.js", "slug": "stats", "verbose": "Highcharts Statistics", "mainview": { @@ -89,7 +89,7 @@ "static": { "public": { "local": { - "path": "/home/mighty/node/modules/express-admin-examples/config/custom/static", + "path": "/home/revlin/Projects/maponics-source/express-admin-examples/config/custom/static", "js": [ "/mtm-tags.js", "/theme.js", @@ -100,6 +100,6 @@ } }, "events": { - "events": "/home/mighty/node/modules/express-admin-examples/config/custom/events/events.js" + "events": "/home/revlin/Projects/maponics-source/express-admin-examples/config/custom/events/events.js" } } \ No newline at end of file diff --git a/config/pg/config.json b/config/pg/config.json index b54a6b1..cbeb2c7 100644 --- a/config/pg/config.json +++ b/config/pg/config.json @@ -2,7 +2,8 @@ "pg": { "database": "express-admin-examples", "user": "liolio", - "password": "karamba" + "password": "karamba", + "schema": "public" }, "server": { "port": 3000 diff --git a/config/sqlite/custom.json b/config/sqlite/custom.json index fa0e46c..1b14e1f 100644 --- a/config/sqlite/custom.json +++ b/config/sqlite/custom.json @@ -1,7 +1,7 @@ { "editors": { "app": { - "path": "/home/mighty/node/modules/express-admin-examples/config/custom/editors/app.js", + "path": "/home/revlin/Projects/maponics-source/express-admin-examples/config/custom/editors/app.js", "slug": "upload" }, "public": { @@ -11,7 +11,7 @@ ] }, "local": { - "path": "/home/mighty/node/modules/express-admin-examples/config/custom/editors", + "path": "/home/revlin/Projects/maponics-source/express-admin-examples/config/custom/editors", "js": [ "/jslib/tinymce/js/tinymce/tinymce.min.js", "/jslib/tinymce/js/tinymce/jquery.tinymce.min.js", @@ -22,7 +22,7 @@ }, "view1": { "app": { - "path": "/home/mighty/node/modules/express-admin-examples/config/custom/app1/app.js", + "path": "/home/revlin/Projects/maponics-source/express-admin-examples/config/custom/app1/app.js", "slug": "view1", "verbose": "Simple", "mainview": { @@ -32,7 +32,7 @@ }, "view2": { "app": { - "path" : "/home/mighty/node/modules/express-admin-examples/config/custom/app2/app.js", + "path" : "/home/revlin/Projects/maponics-source/express-admin-examples/config/custom/app2/app.js", "slug": "view2", "verbose": "Custom global static files", "mainview": { @@ -41,7 +41,7 @@ }, "public": { "local": { - "path": "/home/mighty/node/modules/express-admin-examples/config/custom/app2/public", + "path": "/home/revlin/Projects/maponics-source/express-admin-examples/config/custom/app2/public", "css": [ "/css/global.css" ], @@ -53,7 +53,7 @@ }, "view3": { "app": { - "path" : "/home/mighty/node/modules/express-admin-examples/config/custom/app3/app.js", + "path" : "/home/revlin/Projects/maponics-source/express-admin-examples/config/custom/app3/app.js", "slug": "view3", "verbose": "Custom local static files", "mainview": { @@ -62,13 +62,13 @@ }, "public": { "local": { - "path": "/home/mighty/node/modules/express-admin-examples/config/custom/app3/public" + "path": "/home/revlin/Projects/maponics-source/express-admin-examples/config/custom/app3/public" } } }, "view4": { "app": { - "path" : "/home/mighty/node/modules/express-admin-examples/config/custom/app4/app.js", + "path" : "/home/revlin/Projects/maponics-source/express-admin-examples/config/custom/app4/app.js", "slug": "view4", "verbose": "Breadcrumbs", "mainview": { @@ -78,7 +78,7 @@ }, "stats": { "app": { - "path" : "/home/mighty/node/modules/express-admin-examples/config/custom/highcharts/app.js", + "path" : "/home/revlin/Projects/maponics-source/express-admin-examples/config/custom/highcharts/app.js", "slug": "stats", "verbose": "Highcharts Statistics", "mainview": { @@ -89,7 +89,7 @@ "static": { "public": { "local": { - "path": "/home/mighty/node/modules/express-admin-examples/config/custom/static", + "path": "/home/revlin/Projects/maponics-source/express-admin-examples/config/custom/static", "js": [ "/mtm-tags.js", "/theme.js", @@ -100,6 +100,6 @@ } }, "events": { - "events": "/home/mighty/node/modules/express-admin-examples/config/custom/events/events.js" + "events": "/home/revlin/Projects/maponics-source/express-admin-examples/config/custom/events/events.js" } } \ No newline at end of file diff --git a/fixtures/pg/insert.sql b/fixtures/pg/insert.sql index aa376a8..6e5d68a 100644 --- a/fixtures/pg/insert.sql +++ b/fixtures/pg/insert.sql @@ -1,261 +1,261 @@ -- One to Many -truncate table "user" restart identity cascade; -truncate table "item" restart identity cascade; -truncate table "purchase" restart identity cascade; -alter sequence "item_id_seq" restart with 1; -alter sequence "user_id_seq" restart with 1; -alter sequence "purchase_id_seq" restart with 1; - -insert into "user" ("firstname","lastname","created_at","updated_at") VALUES ('Jeff','Cox','2014-01-10 22:17:13','2014-01-10 22:17:13'); -insert into "user" ("firstname","lastname","created_at","updated_at") VALUES ('Ann','Hart','2014-01-15 14:57:00','2014-01-15 14:57:00'); -insert into "user" ("firstname","lastname","created_at","updated_at") VALUES ('Jack','Dean','2014-01-20 01:12:33','2014-01-20 01:12:33'); - -insert into "item" ("name","image") VALUES ('coffee','http://i.imgur.com/aRGnsmZ.jpg'); -insert into "item" ("name","image") VALUES ('tea','http://i.imgur.com/Q4ifnMA.jpg'); -insert into "item" ("name","image") VALUES ('energy','http://i.imgur.com/MmWBoOR.jpg'); -insert into "item" ("name") VALUES ('cherries'); -insert into "item" ("name") VALUES ('chocolate'); - -insert into "purchase" ("item_id","user_id","cache","date") VALUES (1,3,17.5,'2012-01-01'); -insert into "purchase" ("item_id","user_id","cache","date") VALUES (2,1,37.5,'2012-01-12'); -insert into "purchase" ("item_id","user_id","cache","date") VALUES (1,2,66.0,'2012-01-15'); -insert into "purchase" ("item_id","user_id","cache","date","deleted","deleted_at") VALUES (4,3,15.0,'2012-01-27',true,'2012-03-01 1:15'); -insert into "purchase" ("item_id","user_id","cache","date") VALUES (1,2,18.9,'2012-02-07'); -insert into "purchase" ("item_id","user_id","cache","date") VALUES (2,1,100, '2012-02-19'); -insert into "purchase" ("item_id","user_id","cache","date") VALUES (4,3,20.0,'2012-02-20'); -insert into "purchase" ("item_id","user_id","cache","date") VALUES (2,3,50.0,'2012-03-08'); -insert into "purchase" ("item_id","user_id","cache","date") VALUES (3,1,18.0,'2012-03-16'); -insert into "purchase" ("item_id","user_id","cache","date") VALUES (5,2,9.00,'2012-03-18'); -insert into "purchase" ("item_id","user_id","cache","date") VALUES (2,3,3.50,'2012-03-29'); -insert into "purchase" ("item_id","user_id","cache","date") VALUES (5,1,19.0,'2012-04-09'); -insert into "purchase" ("item_id","user_id","cache","date") VALUES (4,2,22.7,'2012-04-13'); -insert into "purchase" ("item_id","user_id","cache","date") VALUES (3,3,44.5,'2012-04-21'); -insert into "purchase" ("item_id","user_id","cache","date","deleted","deleted_at") VALUES (1,2,12.6,'2012-04-26',true,'2012-04-28 14:57'); -insert into "purchase" ("item_id","user_id","cache","date") VALUES (2,2,16.0,'2012-04-26'); -insert into "purchase" ("item_id","user_id","cache","date") VALUES (2,1,40.0,'2012-05-06'); -insert into "purchase" ("item_id","user_id","cache","date") VALUES (3,2,16.8,'2012-05-15'); -insert into "purchase" ("item_id","user_id","cache","date") VALUES (4,3,9.0, '2012-05-22'); -insert into "purchase" ("item_id","user_id","cache","date") VALUES (2,1,40.0,'2012-06-06'); -insert into "purchase" ("item_id","user_id","cache","date") VALUES (3,2,16.0,'2012-06-15'); -insert into "purchase" ("item_id","user_id","cache","date") VALUES (5,3,19.0,'2012-06-22'); -insert into "purchase" ("item_id","user_id","cache","date","deleted","deleted_at") VALUES (3,3,40.0,'2012-06-24',true,'2012-06-27 7:49'); -insert into "purchase" ("item_id","user_id","cache","date") VALUES (1,3,70.0,'2012-06-27'); +truncate table "public"."user" restart identity cascade; +truncate table "public"."item" restart identity cascade; +truncate table "public"."purchase" restart identity cascade; +alter sequence "public"."item_id_seq" restart with 1; +alter sequence "public"."user_id_seq" restart with 1; +alter sequence "public"."purchase_id_seq" restart with 1; + +insert into "public"."user" ("firstname","lastname","created_at","updated_at") VALUES ('Jeff','Cox','2014-01-10 22:17:13','2014-01-10 22:17:13'); +insert into "public"."user" ("firstname","lastname","created_at","updated_at") VALUES ('Ann','Hart','2014-01-15 14:57:00','2014-01-15 14:57:00'); +insert into "public"."user" ("firstname","lastname","created_at","updated_at") VALUES ('Jack','Dean','2014-01-20 01:12:33','2014-01-20 01:12:33'); + +insert into "public"."item" ("name","image") VALUES ('coffee','http://i.imgur.com/aRGnsmZ.jpg'); +insert into "public"."item" ("name","image") VALUES ('tea','http://i.imgur.com/Q4ifnMA.jpg'); +insert into "public"."item" ("name","image") VALUES ('energy','http://i.imgur.com/MmWBoOR.jpg'); +insert into "public"."item" ("name") VALUES ('cherries'); +insert into "public"."item" ("name") VALUES ('chocolate'); + +insert into "public"."purchase" ("item_id","user_id","cache","date") VALUES (1,3,17.5,'2012-01-01'); +insert into "public"."purchase" ("item_id","user_id","cache","date") VALUES (2,1,37.5,'2012-01-12'); +insert into "public"."purchase" ("item_id","user_id","cache","date") VALUES (1,2,66.0,'2012-01-15'); +insert into "public"."purchase" ("item_id","user_id","cache","date","deleted","deleted_at") VALUES (4,3,15.0,'2012-01-27',true,'2012-03-01 1:15'); +insert into "public"."purchase" ("item_id","user_id","cache","date") VALUES (1,2,18.9,'2012-02-07'); +insert into "public"."purchase" ("item_id","user_id","cache","date") VALUES (2,1,100, '2012-02-19'); +insert into "public"."purchase" ("item_id","user_id","cache","date") VALUES (4,3,20.0,'2012-02-20'); +insert into "public"."purchase" ("item_id","user_id","cache","date") VALUES (2,3,50.0,'2012-03-08'); +insert into "public"."purchase" ("item_id","user_id","cache","date") VALUES (3,1,18.0,'2012-03-16'); +insert into "public"."purchase" ("item_id","user_id","cache","date") VALUES (5,2,9.00,'2012-03-18'); +insert into "public"."purchase" ("item_id","user_id","cache","date") VALUES (2,3,3.50,'2012-03-29'); +insert into "public"."purchase" ("item_id","user_id","cache","date") VALUES (5,1,19.0,'2012-04-09'); +insert into "public"."purchase" ("item_id","user_id","cache","date") VALUES (4,2,22.7,'2012-04-13'); +insert into "public"."purchase" ("item_id","user_id","cache","date") VALUES (3,3,44.5,'2012-04-21'); +insert into "public"."purchase" ("item_id","user_id","cache","date","deleted","deleted_at") VALUES (1,2,12.6,'2012-04-26',true,'2012-04-28 14:57'); +insert into "public"."purchase" ("item_id","user_id","cache","date") VALUES (2,2,16.0,'2012-04-26'); +insert into "public"."purchase" ("item_id","user_id","cache","date") VALUES (2,1,40.0,'2012-05-06'); +insert into "public"."purchase" ("item_id","user_id","cache","date") VALUES (3,2,16.8,'2012-05-15'); +insert into "public"."purchase" ("item_id","user_id","cache","date") VALUES (4,3,9.0, '2012-05-22'); +insert into "public"."purchase" ("item_id","user_id","cache","date") VALUES (2,1,40.0,'2012-06-06'); +insert into "public"."purchase" ("item_id","user_id","cache","date") VALUES (3,2,16.0,'2012-06-15'); +insert into "public"."purchase" ("item_id","user_id","cache","date") VALUES (5,3,19.0,'2012-06-22'); +insert into "public"."purchase" ("item_id","user_id","cache","date","deleted","deleted_at") VALUES (3,3,40.0,'2012-06-24',true,'2012-06-27 7:49'); +insert into "public"."purchase" ("item_id","user_id","cache","date") VALUES (1,3,70.0,'2012-06-27'); -- Many to Many -truncate table "recipe_type" restart identity cascade; -truncate table "recipe_method" restart identity cascade; -truncate table "recipe" restart identity cascade; -truncate table "recipe_has_recipe_types" restart identity cascade; -truncate table "recipe_has_recipe_methods" restart identity cascade; -alter sequence "recipe_id_seq" restart with 1; -alter sequence "recipe_type_id_seq" restart with 1; -alter sequence "recipe_method_id_seq" restart with 1; - -insert into "recipe_type" ("title") VALUES ('type1'); -insert into "recipe_type" ("title") VALUES ('type2'); -insert into "recipe_type" ("title") VALUES ('type3'); -insert into "recipe_type" ("title") VALUES ('type4'); -insert into "recipe_type" ("title") VALUES ('type5'); - -insert into "recipe_method" ("title") VALUES ('method1'); -insert into "recipe_method" ("title") VALUES ('method2'); -insert into "recipe_method" ("title") VALUES ('method3'); -insert into "recipe_method" ("title") VALUES ('method4'); -insert into "recipe_method" ("title") VALUES ('method5'); - -insert into "recipe" ("name") VALUES ('recipe 1'); -insert into "recipe" ("name") VALUES ('recipe 2'); -insert into "recipe" ("name") VALUES ('recipe 3'); -insert into "recipe" ("name") VALUES ('recipe 4'); -insert into "recipe" ("name") VALUES ('recipe 5'); -insert into "recipe" ("name") VALUES ('recipe 6'); -insert into "recipe" ("name") VALUES ('recipe 7'); -insert into "recipe" ("name") VALUES ('recipe 8'); -insert into "recipe" ("name") VALUES ('recipe 9'); - -insert into "recipe_has_recipe_types" ("recipe_id","recipe_type_id") VALUES (1,2); -insert into "recipe_has_recipe_types" ("recipe_id","recipe_type_id") VALUES (1,4); -insert into "recipe_has_recipe_types" ("recipe_id","recipe_type_id") VALUES (1,5); -insert into "recipe_has_recipe_types" ("recipe_id","recipe_type_id") VALUES (2,3); -insert into "recipe_has_recipe_types" ("recipe_id","recipe_type_id") VALUES (2,2); -insert into "recipe_has_recipe_types" ("recipe_id","recipe_type_id") VALUES (2,1); -insert into "recipe_has_recipe_types" ("recipe_id","recipe_type_id") VALUES (3,1); -insert into "recipe_has_recipe_types" ("recipe_id","recipe_type_id") VALUES (3,2); -insert into "recipe_has_recipe_types" ("recipe_id","recipe_type_id") VALUES (5,4); -insert into "recipe_has_recipe_types" ("recipe_id","recipe_type_id") VALUES (6,5); -insert into "recipe_has_recipe_types" ("recipe_id","recipe_type_id") VALUES (6,2); -insert into "recipe_has_recipe_types" ("recipe_id","recipe_type_id") VALUES (7,4); -insert into "recipe_has_recipe_types" ("recipe_id","recipe_type_id") VALUES (7,1); -insert into "recipe_has_recipe_types" ("recipe_id","recipe_type_id") VALUES (7,3); -insert into "recipe_has_recipe_types" ("recipe_id","recipe_type_id") VALUES (8,2); -insert into "recipe_has_recipe_types" ("recipe_id","recipe_type_id") VALUES (9,2); -insert into "recipe_has_recipe_types" ("recipe_id","recipe_type_id") VALUES (9,4); - -insert into "recipe_has_recipe_methods" ("recipe_id","recipe_method_id") VALUES (1,2); -insert into "recipe_has_recipe_methods" ("recipe_id","recipe_method_id") VALUES (1,4); -insert into "recipe_has_recipe_methods" ("recipe_id","recipe_method_id") VALUES (2,5); -insert into "recipe_has_recipe_methods" ("recipe_id","recipe_method_id") VALUES (4,3); -insert into "recipe_has_recipe_methods" ("recipe_id","recipe_method_id") VALUES (5,1); -insert into "recipe_has_recipe_methods" ("recipe_id","recipe_method_id") VALUES (5,3); -insert into "recipe_has_recipe_methods" ("recipe_id","recipe_method_id") VALUES (5,5); -insert into "recipe_has_recipe_methods" ("recipe_id","recipe_method_id") VALUES (6,3); -insert into "recipe_has_recipe_methods" ("recipe_id","recipe_method_id") VALUES (6,4); -insert into "recipe_has_recipe_methods" ("recipe_id","recipe_method_id") VALUES (7,4); -insert into "recipe_has_recipe_methods" ("recipe_id","recipe_method_id") VALUES (8,1); -insert into "recipe_has_recipe_methods" ("recipe_id","recipe_method_id") VALUES (8,2); -insert into "recipe_has_recipe_methods" ("recipe_id","recipe_method_id") VALUES (8,3); -insert into "recipe_has_recipe_methods" ("recipe_id","recipe_method_id") VALUES (9,1); -insert into "recipe_has_recipe_methods" ("recipe_id","recipe_method_id") VALUES (9,2); -insert into "recipe_has_recipe_methods" ("recipe_id","recipe_method_id") VALUES (9,4); -insert into "recipe_has_recipe_methods" ("recipe_id","recipe_method_id") VALUES (9,5); +truncate table "public"."recipe_type" restart identity cascade; +truncate table "public"."recipe_method" restart identity cascade; +truncate table "public"."recipe" restart identity cascade; +truncate table "public"."recipe_has_recipe_types" restart identity cascade; +truncate table "public"."recipe_has_recipe_methods" restart identity cascade; +alter sequence "public"."recipe_id_seq" restart with 1; +alter sequence "public"."recipe_type_id_seq" restart with 1; +alter sequence "public"."recipe_method_id_seq" restart with 1; + +insert into "public"."recipe_type" ("title") VALUES ('type1'); +insert into "public"."recipe_type" ("title") VALUES ('type2'); +insert into "public"."recipe_type" ("title") VALUES ('type3'); +insert into "public"."recipe_type" ("title") VALUES ('type4'); +insert into "public"."recipe_type" ("title") VALUES ('type5'); + +insert into "public"."recipe_method" ("title") VALUES ('method1'); +insert into "public"."recipe_method" ("title") VALUES ('method2'); +insert into "public"."recipe_method" ("title") VALUES ('method3'); +insert into "public"."recipe_method" ("title") VALUES ('method4'); +insert into "public"."recipe_method" ("title") VALUES ('method5'); + +insert into "public"."recipe" ("name") VALUES ('recipe 1'); +insert into "public"."recipe" ("name") VALUES ('recipe 2'); +insert into "public"."recipe" ("name") VALUES ('recipe 3'); +insert into "public"."recipe" ("name") VALUES ('recipe 4'); +insert into "public"."recipe" ("name") VALUES ('recipe 5'); +insert into "public"."recipe" ("name") VALUES ('recipe 6'); +insert into "public"."recipe" ("name") VALUES ('recipe 7'); +insert into "public"."recipe" ("name") VALUES ('recipe 8'); +insert into "public"."recipe" ("name") VALUES ('recipe 9'); + +insert into "public"."recipe_has_recipe_types" ("recipe_id","recipe_type_id") VALUES (1,2); +insert into "public"."recipe_has_recipe_types" ("recipe_id","recipe_type_id") VALUES (1,4); +insert into "public"."recipe_has_recipe_types" ("recipe_id","recipe_type_id") VALUES (1,5); +insert into "public"."recipe_has_recipe_types" ("recipe_id","recipe_type_id") VALUES (2,3); +insert into "public"."recipe_has_recipe_types" ("recipe_id","recipe_type_id") VALUES (2,2); +insert into "public"."recipe_has_recipe_types" ("recipe_id","recipe_type_id") VALUES (2,1); +insert into "public"."recipe_has_recipe_types" ("recipe_id","recipe_type_id") VALUES (3,1); +insert into "public"."recipe_has_recipe_types" ("recipe_id","recipe_type_id") VALUES (3,2); +insert into "public"."recipe_has_recipe_types" ("recipe_id","recipe_type_id") VALUES (5,4); +insert into "public"."recipe_has_recipe_types" ("recipe_id","recipe_type_id") VALUES (6,5); +insert into "public"."recipe_has_recipe_types" ("recipe_id","recipe_type_id") VALUES (6,2); +insert into "public"."recipe_has_recipe_types" ("recipe_id","recipe_type_id") VALUES (7,4); +insert into "public"."recipe_has_recipe_types" ("recipe_id","recipe_type_id") VALUES (7,1); +insert into "public"."recipe_has_recipe_types" ("recipe_id","recipe_type_id") VALUES (7,3); +insert into "public"."recipe_has_recipe_types" ("recipe_id","recipe_type_id") VALUES (8,2); +insert into "public"."recipe_has_recipe_types" ("recipe_id","recipe_type_id") VALUES (9,2); +insert into "public"."recipe_has_recipe_types" ("recipe_id","recipe_type_id") VALUES (9,4); + +insert into "public"."recipe_has_recipe_methods" ("recipe_id","recipe_method_id") VALUES (1,2); +insert into "public"."recipe_has_recipe_methods" ("recipe_id","recipe_method_id") VALUES (1,4); +insert into "public"."recipe_has_recipe_methods" ("recipe_id","recipe_method_id") VALUES (2,5); +insert into "public"."recipe_has_recipe_methods" ("recipe_id","recipe_method_id") VALUES (4,3); +insert into "public"."recipe_has_recipe_methods" ("recipe_id","recipe_method_id") VALUES (5,1); +insert into "public"."recipe_has_recipe_methods" ("recipe_id","recipe_method_id") VALUES (5,3); +insert into "public"."recipe_has_recipe_methods" ("recipe_id","recipe_method_id") VALUES (5,5); +insert into "public"."recipe_has_recipe_methods" ("recipe_id","recipe_method_id") VALUES (6,3); +insert into "public"."recipe_has_recipe_methods" ("recipe_id","recipe_method_id") VALUES (6,4); +insert into "public"."recipe_has_recipe_methods" ("recipe_id","recipe_method_id") VALUES (7,4); +insert into "public"."recipe_has_recipe_methods" ("recipe_id","recipe_method_id") VALUES (8,1); +insert into "public"."recipe_has_recipe_methods" ("recipe_id","recipe_method_id") VALUES (8,2); +insert into "public"."recipe_has_recipe_methods" ("recipe_id","recipe_method_id") VALUES (8,3); +insert into "public"."recipe_has_recipe_methods" ("recipe_id","recipe_method_id") VALUES (9,1); +insert into "public"."recipe_has_recipe_methods" ("recipe_id","recipe_method_id") VALUES (9,2); +insert into "public"."recipe_has_recipe_methods" ("recipe_id","recipe_method_id") VALUES (9,4); +insert into "public"."recipe_has_recipe_methods" ("recipe_id","recipe_method_id") VALUES (9,5); -- One to One -truncate table "address" restart identity cascade; -truncate table "phone" restart identity cascade; -alter sequence "address_id_seq" restart with 1; -alter sequence "phone_id_seq" restart with 1; +truncate table "public"."address" restart identity cascade; +truncate table "public"."phone" restart identity cascade; +alter sequence "public"."address_id_seq" restart with 1; +alter sequence "public"."phone_id_seq" restart with 1; -insert into "address" ("user_id","street") VALUES (1,'South Lake'); -insert into "address" ("user_id","street") VALUES (2,'Steep Hill'); -insert into "address" ("user_id","street") VALUES (3,'Pine Woods'); +insert into "public"."address" ("user_id","street") VALUES (1,'South Lake'); +insert into "public"."address" ("user_id","street") VALUES (2,'Steep Hill'); +insert into "public"."address" ("user_id","street") VALUES (3,'Pine Woods'); -insert into "phone" ("user_id","mobile") VALUES (2,'123-555-5555'); -insert into "phone" ("user_id","mobile") VALUES (3,'456-555-5555'); +insert into "public"."phone" ("user_id","mobile") VALUES (2,'123-555-5555'); +insert into "public"."phone" ("user_id","mobile") VALUES (3,'456-555-5555'); -- Many to One -truncate table "car" restart identity cascade; -truncate table "repair" restart identity cascade; -truncate table "driver" restart identity cascade; -alter sequence "car_id_seq" restart with 1; -alter sequence "repair_id_seq" restart with 1; -alter sequence "driver_id_seq" restart with 1; - -insert into "car" ("model") VALUES ('Lamborghini Diablo'); -insert into "car" ("model") VALUES ('Subaru Impreza'); -insert into "car" ("model") VALUES ('Trabant'); - -insert into "repair" ("car_id","date") VALUES (1,'2013-01-13'); -insert into "repair" ("car_id","date") VALUES (1,'2013-04-07'); -insert into "repair" ("car_id","date") VALUES (2,'2013-02-15'); -insert into "repair" ("car_id","date") VALUES (2,'2013-05-18'); -insert into "repair" ("car_id","date") VALUES (3,'2013-03-12'); -insert into "repair" ("car_id","date") VALUES (3,'2013-01-02'); - -insert into "driver" ("car_id","name") VALUES (1,'John'); -insert into "driver" ("car_id","name") VALUES (1,'Ross'); -insert into "driver" ("car_id","name") VALUES (2,'Ann'); -insert into "driver" ("car_id","name") VALUES (2,'Patrick'); -insert into "driver" ("car_id","name") VALUES (3,'David'); -insert into "driver" ("car_id","name") VALUES (3,'Rossie'); +truncate table "public"."car" restart identity cascade; +truncate table "public"."repair" restart identity cascade; +truncate table "public"."driver" restart identity cascade; +alter sequence "public"."car_id_seq" restart with 1; +alter sequence "public"."repair_id_seq" restart with 1; +alter sequence "public"."driver_id_seq" restart with 1; + +insert into "public"."car" ("model") VALUES ('Lamborghini Diablo'); +insert into "public"."car" ("model") VALUES ('Subaru Impreza'); +insert into "public"."car" ("model") VALUES ('Trabant'); + +insert into "public"."repair" ("car_id","date") VALUES (1,'2013-01-13'); +insert into "public"."repair" ("car_id","date") VALUES (1,'2013-04-07'); +insert into "public"."repair" ("car_id","date") VALUES (2,'2013-02-15'); +insert into "public"."repair" ("car_id","date") VALUES (2,'2013-05-18'); +insert into "public"."repair" ("car_id","date") VALUES (3,'2013-03-12'); +insert into "public"."repair" ("car_id","date") VALUES (3,'2013-01-02'); + +insert into "public"."driver" ("car_id","name") VALUES (1,'John'); +insert into "public"."driver" ("car_id","name") VALUES (1,'Ross'); +insert into "public"."driver" ("car_id","name") VALUES (2,'Ann'); +insert into "public"."driver" ("car_id","name") VALUES (2,'Patrick'); +insert into "public"."driver" ("car_id","name") VALUES (3,'David'); +insert into "public"."driver" ("car_id","name") VALUES (3,'Rossie'); -- Controls -truncate table "controls_mtm_single" restart identity cascade; -truncate table "controls_mtm_multiple" restart identity cascade; +truncate table "public"."controls_mtm_single" restart identity cascade; +truncate table "public"."controls_mtm_multiple" restart identity cascade; -truncate table "controls_has_controls_mtm_single" restart identity cascade; -truncate table "controls_has_controls_mtm_multiple" restart identity cascade; +truncate table "public"."controls_has_controls_mtm_single" restart identity cascade; +truncate table "public"."controls_has_controls_mtm_multiple" restart identity cascade; -truncate table "controls" restart identity cascade; +truncate table "public"."controls" restart identity cascade; -truncate table "controls_otm_single" restart identity cascade; -truncate table "controls_otm_multiple" restart identity cascade; +truncate table "public"."controls_otm_single" restart identity cascade; +truncate table "public"."controls_otm_multiple" restart identity cascade; -truncate table "controls_inline_mtm_single" restart identity cascade; -truncate table "controls_inline_mtm_multiple" restart identity cascade; +truncate table "public"."controls_inline_mtm_single" restart identity cascade; +truncate table "public"."controls_inline_mtm_multiple" restart identity cascade; -truncate table "controls_inline_has_controls_inline_mtm_single" restart identity cascade; -truncate table "controls_inline_has_controls_inline_mtm_multiple" restart identity cascade; +truncate table "public"."controls_inline_has_controls_inline_mtm_single" restart identity cascade; +truncate table "public"."controls_inline_has_controls_inline_mtm_multiple" restart identity cascade; -truncate table "controls_inline" restart identity cascade; +truncate table "public"."controls_inline" restart identity cascade; -truncate table "controls_inline_otm_single" restart identity cascade; -truncate table "controls_inline_otm_multiple" restart identity cascade; +truncate table "public"."controls_inline_otm_single" restart identity cascade; +truncate table "public"."controls_inline_otm_multiple" restart identity cascade; -alter sequence "controls_otm_single_id_seq" restart with 1; -alter sequence "controls_otm_multiple_id_seq" restart with 1; +alter sequence "public"."controls_otm_single_id_seq" restart with 1; +alter sequence "public"."controls_otm_multiple_id_seq" restart with 1; -alter sequence "controls_id_seq" restart with 1; +alter sequence "public"."controls_id_seq" restart with 1; -alter sequence "controls_mtm_single_id_seq" restart with 1; -alter sequence "controls_mtm_multiple_id_seq" restart with 1; +alter sequence "public"."controls_mtm_single_id_seq" restart with 1; +alter sequence "public"."controls_mtm_multiple_id_seq" restart with 1; -alter sequence "controls_inline_otm_single_id_seq" restart with 1; -alter sequence "controls_inline_otm_multiple_id_seq" restart with 1; +alter sequence "public"."controls_inline_otm_single_id_seq" restart with 1; +alter sequence "public"."controls_inline_otm_multiple_id_seq" restart with 1; -alter sequence "controls_inline_id_seq" restart with 1; +alter sequence "public"."controls_inline_id_seq" restart with 1; -alter sequence "controls_inline_mtm_single_id_seq" restart with 1; -alter sequence "controls_inline_mtm_multiple_id_seq" restart with 1; +alter sequence "public"."controls_inline_mtm_single_id_seq" restart with 1; +alter sequence "public"."controls_inline_mtm_multiple_id_seq" restart with 1; -- otm -insert into "controls_otm_single" ("name") values ('one'); -insert into "controls_otm_single" ("name") values ('two'); -insert into "controls_otm_single" ("name") values ('three'); +insert into "public"."controls_otm_single" ("name") values ('one'); +insert into "public"."controls_otm_single" ("name") values ('two'); +insert into "public"."controls_otm_single" ("name") values ('three'); -insert into "controls_otm_multiple" ("first","last") values ('one','two'); -insert into "controls_otm_multiple" ("first") values ('three'); -insert into "controls_otm_multiple" ("first","last") values ('four','five'); +insert into "public"."controls_otm_multiple" ("first","last") values ('one','two'); +insert into "public"."controls_otm_multiple" ("first") values ('three'); +insert into "public"."controls_otm_multiple" ("first","last") values ('four','five'); -insert into "controls_inline_otm_single" ("name") values ('one'); -insert into "controls_inline_otm_single" ("name") values ('two'); -insert into "controls_inline_otm_single" ("name") values ('three'); +insert into "public"."controls_inline_otm_single" ("name") values ('one'); +insert into "public"."controls_inline_otm_single" ("name") values ('two'); +insert into "public"."controls_inline_otm_single" ("name") values ('three'); -insert into "controls_inline_otm_multiple" ("first","last") values ('one','two'); -insert into "controls_inline_otm_multiple" ("first") values ('three'); -insert into "controls_inline_otm_multiple" ("first","last") values ('four','five'); +insert into "public"."controls_inline_otm_multiple" ("first","last") values ('one','two'); +insert into "public"."controls_inline_otm_multiple" ("first") values ('three'); +insert into "public"."controls_inline_otm_multiple" ("first","last") values ('four','five'); -- mtm -insert into "controls_mtm_single" ("name") values ('one'); -insert into "controls_mtm_single" ("name") values ('two'); -insert into "controls_mtm_single" ("name") values ('three'); +insert into "public"."controls_mtm_single" ("name") values ('one'); +insert into "public"."controls_mtm_single" ("name") values ('two'); +insert into "public"."controls_mtm_single" ("name") values ('three'); -insert into "controls_mtm_multiple" ("first","last") values ('one','two'); -insert into "controls_mtm_multiple" ("first") values ('three'); -insert into "controls_mtm_multiple" ("first","last") values ('four','five'); +insert into "public"."controls_mtm_multiple" ("first","last") values ('one','two'); +insert into "public"."controls_mtm_multiple" ("first") values ('three'); +insert into "public"."controls_mtm_multiple" ("first","last") values ('four','five'); -insert into "controls_inline_mtm_single" ("name") values ('one'); -insert into "controls_inline_mtm_single" ("name") values ('two'); -insert into "controls_inline_mtm_single" ("name") values ('three'); +insert into "public"."controls_inline_mtm_single" ("name") values ('one'); +insert into "public"."controls_inline_mtm_single" ("name") values ('two'); +insert into "public"."controls_inline_mtm_single" ("name") values ('three'); -insert into "controls_inline_mtm_multiple" ("first","last") values ('one','two'); -insert into "controls_inline_mtm_multiple" ("first") values ('three'); -insert into "controls_inline_mtm_multiple" ("first","last") values ('four','five'); +insert into "public"."controls_inline_mtm_multiple" ("first","last") values ('one','two'); +insert into "public"."controls_inline_mtm_multiple" ("first") values ('three'); +insert into "public"."controls_inline_mtm_multiple" ("first","last") values ('four','five'); -- controls -insert into "controls" +insert into "public"."controls" ("controls_otm_single_id","controls_otm_multiple_id","static","text","boolean","upload","binary","date","time","datetime","textarea") values (1,1,'two','text','1','file','','2013-12-10','20:36','2014-12-10 7:50','text'); -insert into "controls" +insert into "public"."controls" ("text") values ('all other empty'); -- controls inline -insert into "controls_inline" +insert into "public"."controls_inline" ("controls_id","controls_inline_otm_single_id","controls_inline_otm_multiple_id","static","text","boolean","bigint","double","upload","binary","date","time","datetime","textarea") values (1,2,2,'three','text','1',1000000,15.50,'file','','2013-12-10','20:36','2014-12-10 7:50','text'); -insert into "controls_inline" +insert into "public"."controls_inline" ("controls_id","controls_inline_otm_single_id","controls_inline_otm_multiple_id","static","text","boolean","bigint","double","upload","binary","date","time","datetime","textarea") values (2,3,3,'one','text','0',900,16.67,'file','','2013-12-10','20:36','2014-12-10 7:50','text'); -- link -insert into "controls_has_controls_mtm_single" ("controls_id","controls_mtm_single_id") values (1,1); -insert into "controls_has_controls_mtm_multiple" ("controls_id","controls_mtm_multiple_id") values (1,1); -insert into "controls_has_controls_mtm_multiple" ("controls_id","controls_mtm_multiple_id") values (1,2); -insert into "controls_has_controls_mtm_multiple" ("controls_id","controls_mtm_multiple_id") values (1,3); -insert into "controls_has_controls_mtm_single" ("controls_id","controls_mtm_single_id") values (2,1); -insert into "controls_has_controls_mtm_multiple" ("controls_id","controls_mtm_multiple_id") values (2,1); -insert into "controls_has_controls_mtm_multiple" ("controls_id","controls_mtm_multiple_id") values (2,2); -insert into "controls_has_controls_mtm_multiple" ("controls_id","controls_mtm_multiple_id") values (2,3); +insert into "public"."controls_has_controls_mtm_single" ("controls_id","controls_mtm_single_id") values (1,1); +insert into "public"."controls_has_controls_mtm_multiple" ("controls_id","controls_mtm_multiple_id") values (1,1); +insert into "public"."controls_has_controls_mtm_multiple" ("controls_id","controls_mtm_multiple_id") values (1,2); +insert into "public"."controls_has_controls_mtm_multiple" ("controls_id","controls_mtm_multiple_id") values (1,3); +insert into "public"."controls_has_controls_mtm_single" ("controls_id","controls_mtm_single_id") values (2,1); +insert into "public"."controls_has_controls_mtm_multiple" ("controls_id","controls_mtm_multiple_id") values (2,1); +insert into "public"."controls_has_controls_mtm_multiple" ("controls_id","controls_mtm_multiple_id") values (2,2); +insert into "public"."controls_has_controls_mtm_multiple" ("controls_id","controls_mtm_multiple_id") values (2,3); -- link inline -insert into "controls_inline_has_controls_inline_mtm_single" ("controls_inline_id","controls_inline_mtm_single_id") values (1,1); -insert into "controls_inline_has_controls_inline_mtm_multiple" ("controls_inline_id","controls_inline_mtm_multiple_id") values (1,1); -insert into "controls_inline_has_controls_inline_mtm_multiple" ("controls_inline_id","controls_inline_mtm_multiple_id") values (1,2); -insert into "controls_inline_has_controls_inline_mtm_multiple" ("controls_inline_id","controls_inline_mtm_multiple_id") values (1,3); -insert into "controls_inline_has_controls_inline_mtm_single" ("controls_inline_id","controls_inline_mtm_single_id") values (2,1); -insert into "controls_inline_has_controls_inline_mtm_multiple" ("controls_inline_id","controls_inline_mtm_multiple_id") values (2,1); -insert into "controls_inline_has_controls_inline_mtm_multiple" ("controls_inline_id","controls_inline_mtm_multiple_id") values (2,2); -insert into "controls_inline_has_controls_inline_mtm_multiple" ("controls_inline_id","controls_inline_mtm_multiple_id") values (2,3); +insert into "public"."controls_inline_has_controls_inline_mtm_single" ("controls_inline_id","controls_inline_mtm_single_id") values (1,1); +insert into "public"."controls_inline_has_controls_inline_mtm_multiple" ("controls_inline_id","controls_inline_mtm_multiple_id") values (1,1); +insert into "public"."controls_inline_has_controls_inline_mtm_multiple" ("controls_inline_id","controls_inline_mtm_multiple_id") values (1,2); +insert into "public"."controls_inline_has_controls_inline_mtm_multiple" ("controls_inline_id","controls_inline_mtm_multiple_id") values (1,3); +insert into "public"."controls_inline_has_controls_inline_mtm_single" ("controls_inline_id","controls_inline_mtm_single_id") values (2,1); +insert into "public"."controls_inline_has_controls_inline_mtm_multiple" ("controls_inline_id","controls_inline_mtm_multiple_id") values (2,1); +insert into "public"."controls_inline_has_controls_inline_mtm_multiple" ("controls_inline_id","controls_inline_mtm_multiple_id") values (2,2); +insert into "public"."controls_inline_has_controls_inline_mtm_multiple" ("controls_inline_id","controls_inline_mtm_multiple_id") values (2,3); -- END Controls diff --git a/fixtures/pg/schema.sql b/fixtures/pg/schema.sql index 8f3ece9..d1c843e 100644 --- a/fixtures/pg/schema.sql +++ b/fixtures/pg/schema.sql @@ -1,88 +1,69 @@ -DROP SCHEMA IF EXISTS "express-admin-examples" ; -CREATE SCHEMA IF NOT EXISTS "express-admin-examples"; - - -ALTER TABLE "purchase" DROP CONSTRAINT "item_id"; -ALTER TABLE "purchase" DROP CONSTRAINT "user_id"; -ALTER TABLE "recipe_has_recipe_types" DROP CONSTRAINT "recipe_id"; -ALTER TABLE "recipe_has_recipe_types" DROP CONSTRAINT "recipe_type_id"; -ALTER TABLE "recipe_has_recipe_methods" DROP CONSTRAINT "recipe_id"; -ALTER TABLE "recipe_has_recipe_methods" DROP CONSTRAINT "recipe_method_id"; -ALTER TABLE "address" DROP CONSTRAINT "user_id"; -ALTER TABLE "phone" DROP CONSTRAINT "user_id"; -ALTER TABLE "repair" DROP CONSTRAINT "car_id"; -ALTER TABLE "driver" DROP CONSTRAINT "car_id"; - -ALTER TABLE "controls" DROP CONSTRAINT "controls_otm_single_id"; -ALTER TABLE "controls" DROP CONSTRAINT "controls_otm_multiple_id"; - -ALTER TABLE "controls_has_controls_mtm_single" DROP CONSTRAINT "controls_id"; -ALTER TABLE "controls_has_controls_mtm_single" DROP CONSTRAINT "controls_mtm_single_id"; -ALTER TABLE "controls_has_controls_mtm_multiple" DROP CONSTRAINT "controls_id"; -ALTER TABLE "controls_has_controls_mtm_multiple" DROP CONSTRAINT "controls_mtm_multiple_id"; - -ALTER TABLE "controls_inline" DROP CONSTRAINT "controls_inline_otm_single_id"; -ALTER TABLE "controls_inline" DROP CONSTRAINT "controls_inline_otm_multiple_id"; -ALTER TABLE "controls_inline" DROP CONSTRAINT "controls_id"; - -ALTER TABLE "controls_inline_has_controls_inline_mtm_single" DROP CONSTRAINT "controls_inline_id"; -ALTER TABLE "controls_inline_has_controls_inline_mtm_single" DROP CONSTRAINT "controls_inline_mtm_single_id"; -ALTER TABLE "controls_inline_has_controls_inline_mtm_multiple" DROP CONSTRAINT "controls_inline_id"; -ALTER TABLE "controls_inline_has_controls_inline_mtm_multiple" DROP CONSTRAINT "controls_inline_mtm_multiple_id"; +--DROP SCHEMA IF EXISTS "public" ; +CREATE SCHEMA "public"; +GRANT ALL ON SCHEMA "public" to liolio; +GRANT ALL ON ALL TABLES IN SCHEMA "public" to liolio; +GRANT ALL ON ALL sequences IN SCHEMA "public" to liolio; -- ----------------------------------------------------- -- Table "notes" -- ----------------------------------------------------- -DROP TABLE IF EXISTS "notes" ; -CREATE SEQUENCE notes_id_seq; +--DROP TABLE IF EXISTS "public"."notes" ; +CREATE SEQUENCE "public".notes_id_seq; +ALTER SEQUENCE "public".notes_id_seq OWNER TO liolio; -CREATE TABLE IF NOT EXISTS "notes" ( +CREATE TABLE IF NOT EXISTS "public"."notes" ( "id" INT NOT NULL DEFAULT nextval('notes_id_seq') , "notes1" TEXT NULL , "notes2" TEXT NOT NULL , "notes3" TEXT NULL , "notes4" TEXT NOT NULL , PRIMARY KEY ("id") ); +ALTER TABLE "public"."notes" OWNER TO liolio; -- ----------------------------------------------------- -- Table "item" -- ----------------------------------------------------- -DROP TABLE IF EXISTS "item" ; -CREATE SEQUENCE item_id_seq; +--DROP TABLE IF EXISTS "public"."item" ; +CREATE SEQUENCE "public".item_id_seq; +ALTER SEQUENCE "public".item_id_seq OWNER TO liolio; -CREATE TABLE IF NOT EXISTS "item" ( +CREATE TABLE IF NOT EXISTS "public"."item" ( "id" INT NOT NULL DEFAULT nextval('item_id_seq') , "name" VARCHAR(45) NOT NULL , "description" TEXT NULL , "image" VARCHAR(255) NULL , PRIMARY KEY ("id") ); +ALTER TABLE "public"."item" OWNER TO liolio; -- ----------------------------------------------------- -- Table "user" -- ----------------------------------------------------- -DROP TABLE IF EXISTS "user" ; -CREATE SEQUENCE user_id_seq; +--DROP TABLE IF EXISTS "public"."user" ; +CREATE SEQUENCE "public".user_id_seq; +ALTER SEQUENCE "public".user_id_seq OWNER TO liolio; -CREATE TABLE IF NOT EXISTS "user" ( +CREATE TABLE IF NOT EXISTS "public"."user" ( "id" INT NOT NULL DEFAULT nextval('user_id_seq') , "firstname" VARCHAR(45) NOT NULL , "lastname" VARCHAR(45) NULL , "created_at" TIMESTAMP NOT NULL , "updated_at" TIMESTAMP NOT NULL , PRIMARY KEY ("id") ); +ALTER TABLE "public"."user" OWNER TO liolio; -- ----------------------------------------------------- -- Table "purchase" -- ----------------------------------------------------- -DROP TABLE IF EXISTS "purchase" ; -CREATE SEQUENCE purchase_id_seq; +--DROP TABLE IF EXISTS "public"."purchase" ; +CREATE SEQUENCE "public".purchase_id_seq; +ALTER SEQUENCE "public".purchase_id_seq OWNER TO liolio; -CREATE TABLE IF NOT EXISTS "purchase" ( +CREATE TABLE IF NOT EXISTS "public"."purchase" ( "id" INT NOT NULL DEFAULT nextval('purchase_id_seq') , "item_id" INT NOT NULL , "user_id" INT NULL , @@ -94,103 +75,113 @@ CREATE TABLE IF NOT EXISTS "purchase" ( CONSTRAINT "item_id" FOREIGN KEY ("item_id" ) - REFERENCES "item" ("id" ) + REFERENCES "public"."item" ("id" ) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT "user_id" FOREIGN KEY ("user_id" ) - REFERENCES "user" ("id" ) + REFERENCES "public"."user" ("id" ) ON DELETE NO ACTION ON UPDATE NO ACTION); +ALTER TABLE "public"."purchase" OWNER TO liolio; -- ----------------------------------------------------- -- Table "recipe" -- ----------------------------------------------------- -DROP TABLE IF EXISTS "recipe" ; -CREATE SEQUENCE recipe_id_seq; +--DROP TABLE IF EXISTS "public"."recipe" ; +CREATE SEQUENCE "public".recipe_id_seq; +ALTER SEQUENCE "public".recipe_id_seq OWNER TO liolio; -CREATE TABLE IF NOT EXISTS "recipe" ( +CREATE TABLE IF NOT EXISTS "public"."recipe" ( "id" INT NOT NULL DEFAULT nextval('recipe_id_seq') , "name" VARCHAR(45) NOT NULL , PRIMARY KEY ("id") ); +ALTER TABLE "public"."recipe" OWNER TO liolio; -- ----------------------------------------------------- -- Table "recipe_type" -- ----------------------------------------------------- -DROP TABLE IF EXISTS "recipe_type" ; -CREATE SEQUENCE recipe_type_id_seq; +--DROP TABLE IF EXISTS "public"."recipe_type" ; +CREATE SEQUENCE "public".recipe_type_id_seq; +ALTER SEQUENCE "public".recipe_type_id_seq OWNER TO liolio; -CREATE TABLE IF NOT EXISTS "recipe_type" ( +CREATE TABLE IF NOT EXISTS "public"."recipe_type" ( "id" INT NOT NULL DEFAULT nextval('recipe_type_id_seq') , "title" VARCHAR(45) NOT NULL , PRIMARY KEY ("id") ); +ALTER TABLE "public"."recipe_type" OWNER TO liolio; -- ----------------------------------------------------- -- Table "recipe_method" -- ----------------------------------------------------- -DROP TABLE IF EXISTS "recipe_method" ; -CREATE SEQUENCE recipe_method_id_seq; +--DROP TABLE IF EXISTS "public"."recipe_method" ; +CREATE SEQUENCE "public".recipe_method_id_seq; +ALTER SEQUENCE "public".recipe_method_id_seq OWNER TO liolio; -CREATE TABLE IF NOT EXISTS "recipe_method" ( +CREATE TABLE IF NOT EXISTS "public"."recipe_method" ( "id" INT NOT NULL DEFAULT nextval('recipe_method_id_seq') , "title" VARCHAR(45) NOT NULL , PRIMARY KEY ("id") ); +ALTER TABLE "public"."recipe_method" OWNER TO liolio; -- ----------------------------------------------------- -- Table "recipe_has_recipe_types" -- ----------------------------------------------------- -DROP TABLE IF EXISTS "recipe_has_recipe_types" ; +--DROP TABLE IF EXISTS "public"."recipe_has_recipe_types" ; -CREATE TABLE IF NOT EXISTS "recipe_has_recipe_types" ( +CREATE TABLE IF NOT EXISTS "public"."recipe_has_recipe_types" ( "recipe_id" INT NOT NULL , "recipe_type_id" INT NOT NULL , PRIMARY KEY ("recipe_id", "recipe_type_id") , CONSTRAINT "recipe_type_id" FOREIGN KEY ("recipe_id" ) - REFERENCES "recipe" ("id" ) + REFERENCES "public"."recipe" ("id" ) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT "recipe_id" FOREIGN KEY ("recipe_type_id" ) - REFERENCES "recipe_type" ("id" ) + REFERENCES "public"."recipe_type" ("id" ) ON DELETE NO ACTION ON UPDATE NO ACTION); +ALTER TABLE "public"."recipe_has_recipe_types" OWNER TO liolio; -- ----------------------------------------------------- -- Table "recipe_has_recipe_methods" -- ----------------------------------------------------- -DROP TABLE IF EXISTS "recipe_has_recipe_methods" ; +--DROP TABLE IF EXISTS "public"."recipe_has_recipe_methods" ; -CREATE TABLE IF NOT EXISTS "recipe_has_recipe_methods" ( +CREATE TABLE IF NOT EXISTS "public"."recipe_has_recipe_methods" ( "recipe_id" INT NOT NULL , "recipe_method_id" INT NOT NULL , PRIMARY KEY ("recipe_id", "recipe_method_id") , CONSTRAINT "recipe_method_id" FOREIGN KEY ("recipe_id" ) - REFERENCES "recipe" ("id" ) + REFERENCES "public"."recipe" ("id" ) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT "recipe_id" FOREIGN KEY ("recipe_method_id" ) - REFERENCES "recipe_method" ("id" ) + REFERENCES "public"."recipe_method" ("id" ) ON DELETE NO ACTION ON UPDATE NO ACTION); +ALTER TABLE "public"."recipe_has_recipe_methods" OWNER TO liolio; -- ----------------------------------------------------- -- Table "address" -- ----------------------------------------------------- -DROP TABLE IF EXISTS "address" ; -CREATE SEQUENCE address_id_seq; +--DROP TABLE IF EXISTS "public"."address" ; +CREATE SEQUENCE "public".address_id_seq; +ALTER SEQUENCE "public".address_id_seq OWNER TO liolio; -CREATE TABLE IF NOT EXISTS "address" ( +CREATE TABLE IF NOT EXISTS "public"."address" ( "id" INT NOT NULL DEFAULT nextval('address_id_seq') , "user_id" INT NOT NULL , "street" VARCHAR(45) NOT NULL , @@ -198,18 +189,20 @@ CREATE TABLE IF NOT EXISTS "address" ( CONSTRAINT "user_id" FOREIGN KEY ("user_id" ) - REFERENCES "user" ("id" ) + REFERENCES "public"."user" ("id" ) ON DELETE NO ACTION ON UPDATE NO ACTION); +ALTER TABLE "public"."address" OWNER TO liolio; -- ----------------------------------------------------- -- Table "phone" -- ----------------------------------------------------- -DROP TABLE IF EXISTS "phone" ; -CREATE SEQUENCE phone_id_seq; +--DROP TABLE IF EXISTS "public"."phone" ; +CREATE SEQUENCE "public".phone_id_seq; +ALTER SEQUENCE "public".phone_id_seq OWNER TO liolio; -CREATE TABLE IF NOT EXISTS "phone" ( +CREATE TABLE IF NOT EXISTS "public"."phone" ( "id" INT NOT NULL DEFAULT nextval('phone_id_seq') , "user_id" INT NOT NULL , "mobile" VARCHAR(45) NOT NULL , @@ -217,91 +210,103 @@ CREATE TABLE IF NOT EXISTS "phone" ( CONSTRAINT "user_id" FOREIGN KEY ("user_id" ) - REFERENCES "user" ("id" ) + REFERENCES "public"."user" ("id" ) ON DELETE NO ACTION ON UPDATE NO ACTION); +ALTER TABLE "public"."phone" OWNER TO liolio; -- ----------------------------------------------------- -- Table "car" -- ----------------------------------------------------- -DROP TABLE IF EXISTS "car" ; -CREATE SEQUENCE car_id_seq; +--DROP TABLE IF EXISTS "public"."car" ; +CREATE SEQUENCE "public".car_id_seq; +ALTER SEQUENCE "public".car_id_seq OWNER TO liolio; -CREATE TABLE IF NOT EXISTS "car" ( +CREATE TABLE IF NOT EXISTS "public"."car" ( "id" INT NOT NULL DEFAULT nextval('car_id_seq') , "model" VARCHAR(45) NOT NULL , PRIMARY KEY ("id") ); +ALTER TABLE "public"."car" OWNER TO liolio; -- ----------------------------------------------------- -- Table "repair" -- ----------------------------------------------------- -DROP TABLE IF EXISTS "repair" ; -CREATE SEQUENCE repair_id_seq; +--DROP TABLE IF EXISTS "public"."repair" ; +CREATE SEQUENCE "public".repair_id_seq; +ALTER SEQUENCE "public".repair_id_seq OWNER TO liolio; -CREATE TABLE IF NOT EXISTS "repair" ( +CREATE TABLE IF NOT EXISTS "public"."repair" ( "id" INT NOT NULL DEFAULT nextval('repair_id_seq') , "car_id" INT NOT NULL , "date" DATE NOT NULL , PRIMARY KEY ("id") , CONSTRAINT "car_id" FOREIGN KEY ("car_id" ) - REFERENCES "car" ("id" ) + REFERENCES "public"."car" ("id" ) ON DELETE NO ACTION ON UPDATE NO ACTION); +ALTER TABLE "public"."repair" OWNER TO liolio; -- ----------------------------------------------------- -- Table "driver" -- ----------------------------------------------------- -DROP TABLE IF EXISTS "driver" ; -CREATE SEQUENCE driver_id_seq; +--DROP TABLE IF EXISTS "public"."driver" ; +CREATE SEQUENCE "public".driver_id_seq; +ALTER SEQUENCE "public".driver_id_seq OWNER TO liolio; -CREATE TABLE IF NOT EXISTS "driver" ( +CREATE TABLE IF NOT EXISTS "public"."driver" ( "id" INT NOT NULL DEFAULT nextval('driver_id_seq') , "car_id" INT NOT NULL , "name" VARCHAR(45) NOT NULL , PRIMARY KEY ("id") , CONSTRAINT "car_id" FOREIGN KEY ("car_id" ) - REFERENCES "car" ("id" ) + REFERENCES "public"."car" ("id" ) ON DELETE NO ACTION ON UPDATE NO ACTION); +ALTER TABLE "public"."driver" OWNER TO liolio; -- ----------------------------------------------------- -- Table "controls_otm_single" -- ----------------------------------------------------- -DROP TABLE IF EXISTS "controls_otm_single" ; -CREATE SEQUENCE controls_otm_single_id_seq; +--DROP TABLE IF EXISTS "public"."controls_otm_single" ; +CREATE SEQUENCE "public".controls_otm_single_id_seq; +ALTER SEQUENCE "public".controls_otm_single_id_seq OWNER TO liolio; -CREATE TABLE IF NOT EXISTS "controls_otm_single" ( +CREATE TABLE IF NOT EXISTS "public"."controls_otm_single" ( "id" INT NOT NULL DEFAULT nextval('controls_otm_single_id_seq'), "name" VARCHAR(45) NOT NULL, PRIMARY KEY ("id")); +ALTER TABLE "public"."controls_otm_single" OWNER TO liolio; -- ----------------------------------------------------- -- Table "controls_otm_multiple" -- ----------------------------------------------------- -DROP TABLE IF EXISTS "controls_otm_multiple" ; -CREATE SEQUENCE controls_otm_multiple_id_seq; +--DROP TABLE IF EXISTS "public"."controls_otm_multiple" ; +CREATE SEQUENCE "public".controls_otm_multiple_id_seq; +ALTER SEQUENCE "public".controls_otm_multiple_id_seq OWNER TO liolio; -CREATE TABLE IF NOT EXISTS "controls_otm_multiple" ( +CREATE TABLE IF NOT EXISTS "public"."controls_otm_multiple" ( "id" INT NOT NULL DEFAULT nextval('controls_otm_multiple_id_seq'), "first" VARCHAR(45) NOT NULL, "last" VARCHAR(45) NULL, PRIMARY KEY ("id")); +ALTER TABLE "public"."controls_otm_multiple" OWNER TO liolio; -- ----------------------------------------------------- -- Table "controls" -- ----------------------------------------------------- -DROP TABLE IF EXISTS "controls" ; -CREATE SEQUENCE controls_id_seq; +--DROP TABLE IF EXISTS "public"."controls" ; +CREATE SEQUENCE "public".controls_id_seq; +ALTER SEQUENCE "public".controls_id_seq OWNER TO liolio; -CREATE TABLE IF NOT EXISTS "controls" ( +CREATE TABLE IF NOT EXISTS "public"."controls" ( "id" INT NOT NULL DEFAULT nextval('controls_id_seq'), "controls_otm_single_id" INT NULL, "controls_otm_multiple_id" INT NULL, @@ -319,115 +324,127 @@ CREATE TABLE IF NOT EXISTS "controls" ( PRIMARY KEY ("id"), CONSTRAINT "controls_otm_single_id" FOREIGN KEY ("controls_otm_single_id") - REFERENCES "controls_otm_single" ("id") + REFERENCES "public"."controls_otm_single" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT "controls_otm_multiple_id" FOREIGN KEY ("controls_otm_multiple_id") - REFERENCES "controls_otm_multiple" ("id") + REFERENCES "public"."controls_otm_multiple" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION); +ALTER TABLE "public"."controls" OWNER TO liolio; -- ----------------------------------------------------- -- Table "controls_mtm_single" -- ----------------------------------------------------- -DROP TABLE IF EXISTS "controls_mtm_single" ; -CREATE SEQUENCE controls_mtm_single_id_seq; +--DROP TABLE IF EXISTS "public"."controls_mtm_single" ; +CREATE SEQUENCE "public".controls_mtm_single_id_seq; +ALTER SEQUENCE "public".controls_mtm_single_id_seq OWNER TO liolio; -CREATE TABLE IF NOT EXISTS "controls_mtm_single" ( +CREATE TABLE IF NOT EXISTS "public"."controls_mtm_single" ( "id" INT NOT NULL DEFAULT nextval('controls_mtm_single_id_seq'), "name" VARCHAR(45) NOT NULL, PRIMARY KEY ("id")); +ALTER TABLE "public"."controls_mtm_single" OWNER TO liolio; -- ----------------------------------------------------- -- Table "controls_mtm_multiple" -- ----------------------------------------------------- -DROP TABLE IF EXISTS "controls_mtm_multiple" ; -CREATE SEQUENCE controls_mtm_multiple_id_seq; +--DROP TABLE IF EXISTS "public"."controls_mtm_multiple" ; +CREATE SEQUENCE "public".controls_mtm_multiple_id_seq; +ALTER SEQUENCE "public".controls_mtm_multiple_id_seq OWNER TO liolio; -CREATE TABLE IF NOT EXISTS "controls_mtm_multiple" ( +CREATE TABLE IF NOT EXISTS "public"."controls_mtm_multiple" ( "id" INT NOT NULL DEFAULT nextval('controls_mtm_multiple_id_seq'), "first" VARCHAR(45) NOT NULL, "last" VARCHAR(45) NULL, PRIMARY KEY ("id")); +ALTER TABLE "public"."controls_mtm_multiple" OWNER TO liolio; -- ----------------------------------------------------- -- Table "controls_has_controls_mtm_single" -- ----------------------------------------------------- -DROP TABLE IF EXISTS "controls_has_controls_mtm_single" ; +--DROP TABLE IF EXISTS "public"."controls_has_controls_mtm_single" ; -CREATE TABLE IF NOT EXISTS "controls_has_controls_mtm_single" ( +CREATE TABLE IF NOT EXISTS "public"."controls_has_controls_mtm_single" ( "controls_id" INT NOT NULL, "controls_mtm_single_id" INT NOT NULL, PRIMARY KEY ("controls_id", "controls_mtm_single_id"), CONSTRAINT "controls_id" FOREIGN KEY ("controls_id") - REFERENCES "controls" ("id") + REFERENCES "public"."controls" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT "controls_mtm_single_id" FOREIGN KEY ("controls_mtm_single_id") - REFERENCES "controls_mtm_single" ("id") + REFERENCES "public"."controls_mtm_single" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION); +ALTER TABLE "public"."controls_has_controls_mtm_single" OWNER TO liolio; -- ----------------------------------------------------- -- Table "controls_has_controls_mtm_multiple" -- ----------------------------------------------------- -DROP TABLE IF EXISTS "controls_has_controls_mtm_multiple" ; +--DROP TABLE IF EXISTS "public"."controls_has_controls_mtm_multiple" ; -CREATE TABLE IF NOT EXISTS "controls_has_controls_mtm_multiple" ( +CREATE TABLE IF NOT EXISTS "public"."controls_has_controls_mtm_multiple" ( "controls_id" INT NOT NULL, "controls_mtm_multiple_id" INT NOT NULL, PRIMARY KEY ("controls_id", "controls_mtm_multiple_id"), CONSTRAINT "controls_id" FOREIGN KEY ("controls_id") - REFERENCES "controls" ("id") + REFERENCES "public"."controls" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT "controls_mtm_multiple_id" FOREIGN KEY ("controls_mtm_multiple_id") - REFERENCES "controls_mtm_multiple" ("id") + REFERENCES "public"."controls_mtm_multiple" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION); +ALTER TABLE "public"."controls_has_controls_mtm_multiple" OWNER TO liolio; -- ----------------------------------------------------- -- Table "controls_inline_otm_single" -- ----------------------------------------------------- -DROP TABLE IF EXISTS "controls_inline_otm_single" ; -CREATE SEQUENCE controls_inline_otm_single_id_seq; +--DROP TABLE IF EXISTS "public"."controls_inline_otm_single" ; +CREATE SEQUENCE "public".controls_inline_otm_single_id_seq; +ALTER SEQUENCE "public".controls_inline_otm_single_id_seq OWNER TO liolio; -CREATE TABLE IF NOT EXISTS "controls_inline_otm_single" ( +CREATE TABLE IF NOT EXISTS "public"."controls_inline_otm_single" ( "id" INT NOT NULL DEFAULT nextval('controls_inline_otm_single_id_seq'), "name" VARCHAR(45) NOT NULL, PRIMARY KEY ("id")); +ALTER TABLE "public"."controls_inline_otm_single" OWNER TO liolio; -- ----------------------------------------------------- -- Table "controls_inline_otm_multiple" -- ----------------------------------------------------- -DROP TABLE IF EXISTS "controls_inline_otm_multiple" ; -CREATE SEQUENCE controls_inline_otm_multiple_id_seq; +--DROP TABLE IF EXISTS "public"."controls_inline_otm_multiple" ; +CREATE SEQUENCE "public".controls_inline_otm_multiple_id_seq; +ALTER SEQUENCE "public".controls_inline_otm_multiple_id_seq OWNER TO liolio; -CREATE TABLE IF NOT EXISTS "controls_inline_otm_multiple" ( +CREATE TABLE IF NOT EXISTS "public"."controls_inline_otm_multiple" ( "id" INT NOT NULL DEFAULT nextval('controls_inline_otm_multiple_id_seq'), "first" VARCHAR(45) NOT NULL, "last" VARCHAR(45) NULL, PRIMARY KEY ("id")); +ALTER TABLE "public"."controls_inline_otm_multiple" OWNER TO liolio; -- ----------------------------------------------------- -- Table "controls_inline" -- ----------------------------------------------------- -DROP TABLE IF EXISTS "controls_inline" ; -CREATE SEQUENCE controls_inline_id_seq; +--DROP TABLE IF EXISTS "public"."controls_inline" ; +CREATE SEQUENCE "public".controls_inline_id_seq; +ALTER SEQUENCE "public".controls_inline_id_seq OWNER TO liolio; -CREATE TABLE IF NOT EXISTS "controls_inline" ( +CREATE TABLE IF NOT EXISTS "public"."controls_inline" ( "id" INT NOT NULL DEFAULT nextval('controls_inline_id_seq'), "controls_id" INT NOT NULL, "controls_inline_otm_single_id" INT NOT NULL, @@ -446,83 +463,119 @@ CREATE TABLE IF NOT EXISTS "controls_inline" ( PRIMARY KEY ("id"), CONSTRAINT "controls_inline_otm_single_id" FOREIGN KEY ("controls_inline_otm_single_id") - REFERENCES "controls_inline_otm_single" ("id") + REFERENCES "public"."controls_inline_otm_single" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT "controls_inline_otm_multiple_id" FOREIGN KEY ("controls_inline_otm_multiple_id") - REFERENCES "controls_inline_otm_multiple" ("id") + REFERENCES "public"."controls_inline_otm_multiple" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT "controls_id" FOREIGN KEY ("controls_id") - REFERENCES "controls" ("id") + REFERENCES "public"."controls" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION); +ALTER TABLE "public"."controls_inline" OWNER TO liolio; -- ----------------------------------------------------- -- Table "controls_inline_mtm_single" -- ----------------------------------------------------- -DROP TABLE IF EXISTS "controls_inline_mtm_single" ; -CREATE SEQUENCE controls_inline_mtm_single_id_seq; +--DROP TABLE IF EXISTS "public"."controls_inline_mtm_single" ; +CREATE SEQUENCE "public".controls_inline_mtm_single_id_seq; +ALTER SEQUENCE "public".controls_inline_mtm_single_id_seq OWNER TO liolio; -CREATE TABLE IF NOT EXISTS "controls_inline_mtm_single" ( +CREATE TABLE IF NOT EXISTS "public"."controls_inline_mtm_single" ( "id" INT NOT NULL DEFAULT nextval('controls_inline_mtm_single_id_seq'), "name" VARCHAR(45) NOT NULL, PRIMARY KEY ("id")); +ALTER TABLE "public"."controls_inline_mtm_single" OWNER TO liolio; -- ----------------------------------------------------- -- Table "controls_inline_mtm_multiple" -- ----------------------------------------------------- -DROP TABLE IF EXISTS "controls_inline_mtm_multiple" ; -CREATE SEQUENCE controls_inline_mtm_multiple_id_seq; +--DROP TABLE IF EXISTS "public"."controls_inline_mtm_multiple" ; +CREATE SEQUENCE "public".controls_inline_mtm_multiple_id_seq; +ALTER SEQUENCE "public".controls_inline_mtm_multiple_id_seq OWNER TO liolio; -CREATE TABLE IF NOT EXISTS "controls_inline_mtm_multiple" ( +CREATE TABLE IF NOT EXISTS "public"."controls_inline_mtm_multiple" ( "id" INT NOT NULL DEFAULT nextval('controls_inline_mtm_multiple_id_seq'), "first" VARCHAR(45) NOT NULL, "last" VARCHAR(45) NULL, PRIMARY KEY ("id")); +ALTER TABLE "public"."controls_inline_mtm_multiple" OWNER TO liolio; -- ----------------------------------------------------- -- Table "controls_inline_has_controls_inline_mtm_single" -- ----------------------------------------------------- -DROP TABLE IF EXISTS "controls_inline_has_controls_inline_mtm_single" ; +--DROP TABLE IF EXISTS "public"."controls_inline_has_controls_inline_mtm_single" ; -CREATE TABLE IF NOT EXISTS "controls_inline_has_controls_inline_mtm_single" ( +CREATE TABLE IF NOT EXISTS "public"."controls_inline_has_controls_inline_mtm_single" ( "controls_inline_id" INT NOT NULL, "controls_inline_mtm_single_id" INT NOT NULL, PRIMARY KEY ("controls_inline_id", "controls_inline_mtm_single_id"), CONSTRAINT "controls_inline_id" FOREIGN KEY ("controls_inline_id") - REFERENCES "controls_inline" ("id") + REFERENCES "public"."controls_inline" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT "controls_inline_mtm_single_id" FOREIGN KEY ("controls_inline_mtm_single_id") - REFERENCES "controls_inline_mtm_single" ("id") + REFERENCES "public"."controls_inline_mtm_single" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION); +ALTER TABLE "public"."controls_inline_has_controls_inline_mtm_single" OWNER TO liolio; -- ----------------------------------------------------- -- Table "controls_inline_has_controls_inline_mtm_multiple" -- ----------------------------------------------------- -DROP TABLE IF EXISTS "controls_inline_has_controls_inline_mtm_multiple" ; +--DROP TABLE IF EXISTS "public"."controls_inline_has_controls_inline_mtm_multiple" ; -CREATE TABLE IF NOT EXISTS "controls_inline_has_controls_inline_mtm_multiple" ( +CREATE TABLE IF NOT EXISTS "public"."controls_inline_has_controls_inline_mtm_multiple" ( "controls_inline_id" INT NOT NULL, "controls_inline_mtm_multiple_id" INT NOT NULL, PRIMARY KEY ("controls_inline_id", "controls_inline_mtm_multiple_id"), CONSTRAINT "controls_inline_id" FOREIGN KEY ("controls_inline_id") - REFERENCES "controls_inline" ("id") + REFERENCES "public"."controls_inline" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT "controls_inline_mtm_multiple_id" FOREIGN KEY ("controls_inline_mtm_multiple_id") - REFERENCES "controls_inline_mtm_multiple" ("id") + REFERENCES "public"."controls_inline_mtm_multiple" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION); +ALTER TABLE "public"."controls_inline_has_controls_inline_mtm_multiple" OWNER TO liolio; + + +ALTER TABLE "public"."purchase" DROP CONSTRAINT "item_id"; +ALTER TABLE "public"."purchase" DROP CONSTRAINT "user_id"; +ALTER TABLE "public"."recipe_has_recipe_types" DROP CONSTRAINT "recipe_id"; +ALTER TABLE "public"."recipe_has_recipe_types" DROP CONSTRAINT "recipe_type_id"; +ALTER TABLE "public"."recipe_has_recipe_methods" DROP CONSTRAINT "recipe_id"; +ALTER TABLE "public"."recipe_has_recipe_methods" DROP CONSTRAINT "recipe_method_id"; +ALTER TABLE "public"."address" DROP CONSTRAINT "user_id"; +ALTER TABLE "public"."phone" DROP CONSTRAINT "user_id"; +ALTER TABLE "public"."repair" DROP CONSTRAINT "car_id"; +ALTER TABLE "public"."driver" DROP CONSTRAINT "car_id"; + +ALTER TABLE "public"."controls" DROP CONSTRAINT "controls_otm_single_id"; +ALTER TABLE "public"."controls" DROP CONSTRAINT "controls_otm_multiple_id"; + +ALTER TABLE "public"."controls_has_controls_mtm_single" DROP CONSTRAINT "controls_id"; +ALTER TABLE "public"."controls_has_controls_mtm_single" DROP CONSTRAINT "controls_mtm_single_id"; +ALTER TABLE "public"."controls_has_controls_mtm_multiple" DROP CONSTRAINT "controls_id"; +ALTER TABLE "public"."controls_has_controls_mtm_multiple" DROP CONSTRAINT "controls_mtm_multiple_id"; + +ALTER TABLE "public"."controls_inline" DROP CONSTRAINT "controls_inline_otm_single_id"; +ALTER TABLE "public"."controls_inline" DROP CONSTRAINT "controls_inline_otm_multiple_id"; +ALTER TABLE "public"."controls_inline" DROP CONSTRAINT "controls_id"; + +ALTER TABLE "public"."controls_inline_has_controls_inline_mtm_single" DROP CONSTRAINT "controls_inline_id"; +ALTER TABLE "public"."controls_inline_has_controls_inline_mtm_single" DROP CONSTRAINT "controls_inline_mtm_single_id"; +ALTER TABLE "public"."controls_inline_has_controls_inline_mtm_multiple" DROP CONSTRAINT "controls_inline_id"; +ALTER TABLE "public"."controls_inline_has_controls_inline_mtm_multiple" DROP CONSTRAINT "controls_inline_mtm_multiple_id"; diff --git a/package.json b/package.json index f28b59d..ee224b0 100644 --- a/package.json +++ b/package.json @@ -1,23 +1,26 @@ { - "name": "express-admin-examples", - "version": "1.0.0", - "description": "Examples for Express Admin.", - "license" : "MIT", - "homepage" : "https://github.com/simov/express-admin-examples", - "author": { - "name" : "simo", - "email" : "simeonvelichkov@gmail.com" - }, - "repository": { - "type" : "git", - "url" : "git://github.com/simov/express-admin-examples.git" - }, - "dependencies": { - "express" : "3.4.4", - "moment" : "*", - "cloudinary" : "*" - }, - "scripts": { - "postinstall": "node path.js" - } -} \ No newline at end of file + "name": "express-admin-examples", + "version": "1.0.0", + "description": "Examples for Express Admin.", + "license": "MIT", + "homepage": "https://github.com/simov/express-admin-examples", + "author": { + "name": "simo", + "email": "simeonvelichkov@gmail.com" + }, + "repository": { + "type": "git", + "url": "git://github.com/simov/express-admin-examples.git" + }, + "dependencies": { + "express": "~3.4.4", + "express-admin": "~1.2.6", + "moment": "*", + "cloudinary": "*", + "pg": "*", + "util": "*" + }, + "scripts": { + "postinstall": "node path.js" + } +} diff --git a/path.js b/path.js index 32753d2..b0481f6 100644 --- a/path.js +++ b/path.js @@ -1,13 +1,21 @@ #!/usr/bin/env node +'use strict'; var fs = require('fs'), - path = require('path'); + path = require('path'), + util = require('util'); -['mysql', 'pg', 'sqlite'].forEach(function (engine) { - var fpath = path.join(__dirname, './config/', engine, '/custom.json'); +['mysql', 'pg', 'sqlite'].forEach(function (engine) { + var cwd = (process.env.OS && process.env.OS.match(/Windows/) !== null)? + __dirname.replace(/\\/g, "/"): + __dirname; + + var fpath = path.join(cwd, './config/', engine, '/custom.json'); var data = fs.readFileSync(fpath, 'utf8'); fs.writeFileSync(fpath, - data.replace(/\/home\/mighty\/node\/modules\/express-admin-examples/g, __dirname) + data.replace(/\/home\/mighty\/node\/modules\/express-admin-examples/g, function(m){ + return cwd; + }) ); });