generated from pieceowater-dev/lotof.sample.svc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e3c746e
commit b680146
Showing
21 changed files
with
389 additions
and
55 deletions.
There are no files selected for viewing
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
-- Create "posts" table | ||
CREATE TABLE "public"."posts" ( | ||
"id" bigserial NOT NULL, | ||
"created_at" timestamptz NULL, | ||
"updated_at" timestamptz NULL, | ||
"deleted_at" timestamptz NULL, | ||
"title" text NOT NULL, | ||
"description" text NULL, | ||
"phrase" text NULL, | ||
PRIMARY KEY ("id") | ||
); | ||
-- Create index "idx_posts_deleted_at" to table: "posts" | ||
CREATE INDEX "idx_posts_deleted_at" ON "public"."posts" ("deleted_at"); | ||
-- Create "post_locations" table | ||
CREATE TABLE "public"."post_locations" ( | ||
"id" bigserial NOT NULL, | ||
"created_at" timestamptz NULL, | ||
"updated_at" timestamptz NULL, | ||
"deleted_at" timestamptz NULL, | ||
"post_id" bigint NOT NULL, | ||
"comment" text NULL, | ||
"country" text NULL, | ||
"city" text NULL, | ||
"address" text NULL, | ||
"latitude" numeric NULL, | ||
"longitude" numeric NULL, | ||
PRIMARY KEY ("id"), | ||
CONSTRAINT "fk_posts_location" FOREIGN KEY ("post_id") REFERENCES "public"."posts" ("id") ON UPDATE NO ACTION ON DELETE CASCADE | ||
); | ||
-- Create index "idx_post_locations_deleted_at" to table: "post_locations" | ||
CREATE INDEX "idx_post_locations_deleted_at" ON "public"."post_locations" ("deleted_at"); | ||
-- Create index "idx_post_locations_post_id" to table: "post_locations" | ||
CREATE UNIQUE INDEX "idx_post_locations_post_id" ON "public"."post_locations" ("post_id"); | ||
-- Create "records" table | ||
CREATE TABLE "public"."records" ( | ||
"id" bigserial NOT NULL, | ||
"created_at" timestamptz NULL, | ||
"updated_at" timestamptz NULL, | ||
"deleted_at" timestamptz NULL, | ||
"post_id" bigint NOT NULL, | ||
"user_id" text NOT NULL, | ||
"timestamp" timestamptz NULL, | ||
"method" bigint NULL DEFAULT 0, | ||
PRIMARY KEY ("id"), | ||
CONSTRAINT "fk_posts_records" FOREIGN KEY ("post_id") REFERENCES "public"."posts" ("id") ON UPDATE NO ACTION ON DELETE CASCADE | ||
); | ||
-- Create index "idx_records_deleted_at" to table: "records" | ||
CREATE INDEX "idx_records_deleted_at" ON "public"."records" ("deleted_at"); | ||
-- Create index "idx_records_post_id" to table: "records" | ||
CREATE INDEX "idx_records_post_id" ON "public"."records" ("post_id"); | ||
-- Create "routes" table | ||
CREATE TABLE "public"."routes" ( | ||
"id" bigserial NOT NULL, | ||
"created_at" timestamptz NULL, | ||
"updated_at" timestamptz NULL, | ||
"deleted_at" timestamptz NULL, | ||
"title" text NOT NULL, | ||
PRIMARY KEY ("id") | ||
); | ||
-- Create index "idx_routes_deleted_at" to table: "routes" | ||
CREATE INDEX "idx_routes_deleted_at" ON "public"."routes" ("deleted_at"); | ||
-- Create "route_milestones" table | ||
CREATE TABLE "public"."route_milestones" ( | ||
"id" bigserial NOT NULL, | ||
"created_at" timestamptz NULL, | ||
"updated_at" timestamptz NULL, | ||
"deleted_at" timestamptz NULL, | ||
"route_id" bigint NOT NULL, | ||
"post_id" bigint NOT NULL, | ||
"priority" bigint NOT NULL, | ||
PRIMARY KEY ("id"), | ||
CONSTRAINT "fk_routes_milestones" FOREIGN KEY ("route_id") REFERENCES "public"."routes" ("id") ON UPDATE NO ACTION ON DELETE CASCADE | ||
); | ||
-- Create index "idx_route_milestones_deleted_at" to table: "route_milestones" | ||
CREATE INDEX "idx_route_milestones_deleted_at" ON "public"."route_milestones" ("deleted_at"); | ||
-- Create index "idx_route_milestones_post_id" to table: "route_milestones" | ||
CREATE INDEX "idx_route_milestones_post_id" ON "public"."route_milestones" ("post_id"); | ||
-- Create index "idx_route_milestones_route_id" to table: "route_milestones" | ||
CREATE INDEX "idx_route_milestones_route_id" ON "public"."route_milestones" ("route_id"); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
h1:wGR9nmeFxEUmTtaAr2Oi4a1GtuuJC9kt2HgOwhfezsg= | ||
20241123162350.sql h1:ucccYXCMMwRyWWgS7e7u0u4f6HJao1f5A99pU8b8Wmg= | ||
20241130181357.sql h1:pyiMsKk28BUQ+6tMFvhi9joJjlHHxLdoHAy/td4ULf0= | ||
h1:femykkwctNFDgBmoEKDaWHh9xRDLkkhsByercBborLI= | ||
20241223103039.sql h1:rWABiWO7Q0v5wLNrn+RO0wKuW9i6sKmghutB98U76sI= |
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
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
Oops, something went wrong.