Implement company provisioning codes and session tweaks
This commit is contained in:
parent
0fb9bf59b2
commit
2cba553efa
28 changed files with 1407 additions and 534 deletions
|
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
Warnings:
|
||||
|
||||
- Added the required column `provisioningCode` to the `Company` table without a default value. This is not possible if the table is not empty.
|
||||
|
||||
*/
|
||||
-- RedefineTables
|
||||
PRAGMA defer_foreign_keys=ON;
|
||||
PRAGMA foreign_keys=OFF;
|
||||
CREATE TABLE "new_Company" (
|
||||
"id" TEXT NOT NULL PRIMARY KEY,
|
||||
"tenantId" TEXT NOT NULL,
|
||||
"name" TEXT NOT NULL,
|
||||
"slug" TEXT NOT NULL,
|
||||
"provisioningCode" TEXT NOT NULL,
|
||||
"isAvulso" BOOLEAN NOT NULL DEFAULT false,
|
||||
"contractedHoursPerMonth" REAL,
|
||||
"cnpj" TEXT,
|
||||
"domain" TEXT,
|
||||
"phone" TEXT,
|
||||
"description" TEXT,
|
||||
"address" TEXT,
|
||||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" DATETIME NOT NULL
|
||||
);
|
||||
INSERT INTO "new_Company" ("address", "cnpj", "contractedHoursPerMonth", "createdAt", "description", "domain", "id", "isAvulso", "name", "phone", "slug", "tenantId", "updatedAt") SELECT "address", "cnpj", "contractedHoursPerMonth", "createdAt", "description", "domain", "id", "isAvulso", "name", "phone", "slug", "tenantId", "updatedAt" FROM "Company";
|
||||
DROP TABLE "Company";
|
||||
ALTER TABLE "new_Company" RENAME TO "Company";
|
||||
CREATE UNIQUE INDEX "Company_provisioningCode_key" ON "Company"("provisioningCode");
|
||||
CREATE INDEX "Company_tenantId_name_idx" ON "Company"("tenantId", "name");
|
||||
CREATE UNIQUE INDEX "Company_tenantId_slug_key" ON "Company"("tenantId", "slug");
|
||||
PRAGMA foreign_keys=ON;
|
||||
PRAGMA defer_foreign_keys=OFF;
|
||||
|
|
@ -75,6 +75,7 @@ model Company {
|
|||
tenantId String
|
||||
name String
|
||||
slug String
|
||||
provisioningCode String @unique
|
||||
isAvulso Boolean @default(false)
|
||||
contractedHoursPerMonth Float?
|
||||
cnpj String?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue