Files
simrsx-be/cmd/simgos-sync-migration/migrations/20251209083238.sql
2025-12-09 15:33:08 +07:00

73 lines
2.0 KiB
SQL

-- Create "DoctorLink" table
CREATE TABLE "public"."DoctorLink" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Simx_Id" bigint NULL,
"Simgos_Id" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_DoctorLink_Simgos_Id" UNIQUE ("Simgos_Id"),
CONSTRAINT "uni_DoctorLink_Simx_Id" UNIQUE ("Simx_Id")
);
-- Create "DoctorSimgosLog" table
CREATE TABLE "public"."DoctorSimgosLog" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Value" text NULL,
"Date" timestamptz NULL,
"Status" text NULL,
"ErrMessage" text NULL,
PRIMARY KEY ("Id")
);
-- Create "DoctorSimxLog" table
CREATE TABLE "public"."DoctorSimxLog" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Value" text NULL,
"Date" timestamptz NULL,
"Status" text NULL,
"ErrMessage" text NULL,
PRIMARY KEY ("Id")
);
-- Create "NurseLink" table
CREATE TABLE "public"."NurseLink" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Simx_Id" bigint NULL,
"Simgos_Id" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_NurseLink_Simgos_Id" UNIQUE ("Simgos_Id"),
CONSTRAINT "uni_NurseLink_Simx_Id" UNIQUE ("Simx_Id")
);
-- Create "NurseSimgosLog" table
CREATE TABLE "public"."NurseSimgosLog" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Value" text NULL,
"Date" timestamptz NULL,
"Status" text NULL,
"ErrMessage" text NULL,
PRIMARY KEY ("Id")
);
-- Create "NurseSimxLog" table
CREATE TABLE "public"."NurseSimxLog" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Value" text NULL,
"Date" timestamptz NULL,
"Status" text NULL,
"ErrMessage" text NULL,
PRIMARY KEY ("Id")
);