summaryrefslogtreecommitdiff
path: root/Database
diff options
context:
space:
mode:
authorSerghei Cebotari <serghei@cebotari.ru>2024-01-14 15:07:03 +0300
committerSerghei Cebotari <serghei@cebotari.ru>2024-01-14 15:07:03 +0300
commit722a394d03773f966836a96884ee9e99e26bd780 (patch)
treecfd3870ad6dbd61171e6d781db3aeb86c7700a85 /Database
parent0eb65e2df20823f2ca6abb29b55d22eb6f439bd3 (diff)
Docker files update
Diffstat (limited to 'Database')
-rw-r--r--Database/Dockerfile6
-rw-r--r--Database/init-database.sql25
2 files changed, 31 insertions, 0 deletions
diff --git a/Database/Dockerfile b/Database/Dockerfile
new file mode 100644
index 0000000..a5b3787
--- /dev/null
+++ b/Database/Dockerfile
@@ -0,0 +1,6 @@
+FROM postgres:16.1 AS build
+ADD ./init-database.sql /docker-entrypoint-initdb.d
+RUN chmod 644 /docker-entrypoint-initdb.d/init-database.sql
+EXPOSE 5432
+ENTRYPOINT [ "docker-entrypoint.sh" ]
+CMD [ "postgres" ] \ No newline at end of file
diff --git a/Database/init-database.sql b/Database/init-database.sql
new file mode 100644
index 0000000..91e9f95
--- /dev/null
+++ b/Database/init-database.sql
@@ -0,0 +1,25 @@
+CREATE TABLE IF NOT EXISTS "__EFMigrationsHistory" (
+ "MigrationId" character varying(150) NOT NULL,
+ "ProductVersion" character varying(32) NOT NULL,
+ CONSTRAINT "PK___EFMigrationsHistory" PRIMARY KEY ("MigrationId")
+);
+
+START TRANSACTION;
+
+CREATE TABLE "Products" (
+ "Id" text NOT NULL,
+ "Name" text NOT NULL,
+ "ProductSku" text NOT NULL,
+ "DeprecatedSkus" text[] NOT NULL,
+ "ProductLines" text[] NOT NULL,
+ "IsOnWarehouse" boolean NOT NULL,
+ "ProductMeasure" integer NOT NULL,
+ "DeliveryMakeUp" double precision NULL,
+ "Price" numeric NOT NULL,
+ CONSTRAINT "PK_Products" PRIMARY KEY ("Id")
+);
+
+INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
+VALUES ('20230511043408_Init', '7.0.5');
+
+COMMIT; \ No newline at end of file