-
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.
feat(envited.ascs.digital): add company profile table (#61)
- Loading branch information
Showing
9 changed files
with
1,422 additions
and
4 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
apps/envited.ascs.digital/common/database/data/companyCategories.ts
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,32 @@ | ||
export const COMPANY_CATEGORIES = [ | ||
{ | ||
id: 'oem', | ||
name: 'OEM', | ||
description: 'Original Equipment Manufacturer', | ||
}, | ||
{ | ||
id: 'supplier', | ||
name: 'Supplier', | ||
description: 'Supplier', | ||
}, | ||
{ | ||
id: 'data-provider', | ||
name: 'Data Provider', | ||
description: 'Data Provider', | ||
}, | ||
{ | ||
id: 'service-provider', | ||
name: 'Service Provider', | ||
description: 'Service Provider', | ||
}, | ||
{ | ||
id: 'tool-vendor', | ||
name: 'Tool Vendor', | ||
description: 'Tool Vendor', | ||
}, | ||
{ | ||
id: 'academics', | ||
name: 'Academics', | ||
description: 'Academics', | ||
}, | ||
] |
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
43 changes: 43 additions & 0 deletions
43
apps/envited.ascs.digital/drizzle/development/0001_mysterious_kree.sql
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,43 @@ | ||
CREATE TABLE IF NOT EXISTS "companyCategory" ( | ||
"id" text PRIMARY KEY NOT NULL, | ||
"name" text, | ||
"description" text, | ||
CONSTRAINT "companyCategory_id_unique" UNIQUE("id"), | ||
CONSTRAINT "companyCategory_name_unique" UNIQUE("name") | ||
); | ||
--> statement-breakpoint | ||
CREATE TABLE IF NOT EXISTS "profile" ( | ||
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL, | ||
"name" text, | ||
"description" text, | ||
"logo" text, | ||
"street_address" text, | ||
"postal_code" text, | ||
"address_locality" text, | ||
"address_country" text, | ||
"first_name" text, | ||
"last_name" text, | ||
"phone" text, | ||
"email" text, | ||
"website" text, | ||
"offerings" jsonb, | ||
CONSTRAINT "profile_name_unique" UNIQUE("name") | ||
); | ||
--> statement-breakpoint | ||
CREATE TABLE IF NOT EXISTS "profilesToCompanyCategories" ( | ||
"profile_id" uuid NOT NULL, | ||
"company_category_id" text NOT NULL | ||
); | ||
--> statement-breakpoint | ||
ALTER TABLE "user" RENAME COLUMN "address_location" TO "address_locality";--> statement-breakpoint | ||
DO $$ BEGIN | ||
ALTER TABLE "profilesToCompanyCategories" ADD CONSTRAINT "profilesToCompanyCategories_profile_id_profile_id_fk" FOREIGN KEY ("profile_id") REFERENCES "public"."profile"("id") ON DELETE no action ON UPDATE no action; | ||
EXCEPTION | ||
WHEN duplicate_object THEN null; | ||
END $$; | ||
--> statement-breakpoint | ||
DO $$ BEGIN | ||
ALTER TABLE "profilesToCompanyCategories" ADD CONSTRAINT "profilesToCompanyCategories_company_category_id_companyCategory_id_fk" FOREIGN KEY ("company_category_id") REFERENCES "public"."companyCategory"("id") ON DELETE no action ON UPDATE no action; | ||
EXCEPTION | ||
WHEN duplicate_object THEN null; | ||
END $$; |
Oops, something went wrong.