Skip to content

Instantly share code, notes, and snippets.

@RR-Helpdesk
Last active October 13, 2023 07:46
Show Gist options
  • Save RR-Helpdesk/009394ade0e5172c506c1592222b2344 to your computer and use it in GitHub Desktop.
Save RR-Helpdesk/009394ade0e5172c506c1592222b2344 to your computer and use it in GitHub Desktop.
Postgres Snippets
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