0
0
RhSolutions-Api/Database/init-database.sql
Serghei Cebotari 2a759b8d39
All checks were successful
Test API / build (push) Successful in 2m48s
Update sql script
2024-01-23 23:30:48 +03:00

27 lines
841 B
SQL

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,
"Price" numeric NOT NULL,
CONSTRAINT "PK_Products" PRIMARY KEY ("Id")
);
CREATE INDEX "IX_Products_Name" ON "Products" USING GIN (to_tsvector('russian', "Name"));
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240117210635_Init', '8.0.0');
COMMIT;