Last active
October 13, 2023 07:46
-
-
Save RR-Helpdesk/009394ade0e5172c506c1592222b2344 to your computer and use it in GitHub Desktop.
Postgres Snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP TABLE "public"."varCalcValue"; | |
CREATE TABLE "public"."varCalcValue" ( | |
"id" bigint NOT NULL GENERATED ALWAYS AS IDENTITY, | |
"varCalcValue" VARCHAR(50) NOT NULL, | |
"createdOn" TIMESTAMP NULL, | |
"updatedOn" TIMESTAMP NULL | |
); | |
CREATE TABLE new_table_name AS | |
SELECT * FROM "uniRoomTypeValueCode"" | |
WHERE conditions; | |
INSERT INTO "uniRoomTypeFeature" | |
SELECT "uniRoomTypeFeatureName", "uniRoomTypeFeature" | |
FROM "RoomTypeFeatures" | |
INSERT INTO "uniRoomTypeFeature"("uniRoomTypeFeatureName", "uniRoomTypeFeature") | |
SELECT | |
"uniRoomTypeFeatureName", | |
"uniRoomTypeFeature" | |
FROM | |
"public"."RoomTypeFeatures" | |
CONSTRAINT "varCalcValue_pkey" PRIMARY KEY ("id") | |
ALTER TABLE | |
"public"."varCalcValue" | |
ADD | |
CONSTRAINT property_pkey PRIMARY KEY (id) | |
CREATE TABLE "public"."varCalcType" ( | |
"id" bigint NOT NULL GENERATED ALWAYS AS IDENTITY, | |
"varCalcType" VARCHAR(50) NOT NULL, | |
"varCalcTypeDescription" VARCHAR(250) NULL, | |
"createdOn" TIMESTAMP NULL, | |
"updatedOn" TIMESTAMP NULL, | |
CONSTRAINT "varCalcType_pkey" PRIMARY KEY ("id") | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment