.. | ||
README.md | ||
schema.prisma | ||
steps.json |
Migration 20201110194349-init
This migration has been generated by Douglas Barone at 11/10/2020, 3:43:49 PM. You can check out the state of the schema after the migration.
Database Steps
CREATE TABLE "public"."ResetToken" (
"id" SERIAL,
"token" text NOT NULL ,
"expiration" timestamp(3) NOT NULL ,
"usedAt" timestamp(3) ,
"createdAt" timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" timestamp(3) NOT NULL ,
"userId" integer NOT NULL ,
"creatorId" integer NOT NULL ,
PRIMARY KEY ("id")
)
CREATE TABLE "public"."User" (
"id" SERIAL,
"lastLogin" timestamp(3) ,
"lastLoginPrior" timestamp(3) ,
"roles" jsonb ,
"groups" jsonb ,
"createdAt" timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" timestamp(3) NOT NULL ,
"accountExpires" text ,
"badPasswordTime" text ,
"badPwdCount" text ,
"cn" text ,
"department" text ,
"description" text ,
"displayName" text ,
"distinguishedName" text ,
"dn" text ,
"extensionAttribute1" text ,
"extensionAttribute10" text ,
"extensionAttribute2" text ,
"extensionAttribute6" text ,
"extensionAttribute7" text ,
"givenName" text ,
"homeDirectory" text ,
"homeDrive" text ,
"lastLogoff" text ,
"lastLogon" text ,
"lastLogonTimestamp" text ,
"lockoutTime" text ,
"logonCount" text ,
"mail" text ,
"name" text ,
"objectCategory" text ,
"objectGUID" text ,
"objectSid" text ,
"primaryGroupID" text ,
"pwdLastSet" timestamp(3) ,
"sAMAccountName" text NOT NULL ,
"sAMAccountType" text ,
"sn" text ,
"thumbnailPhoto" text ,
"title" text ,
"userAccountControl" text ,
"userPrincipalName" text ,
"whenChanged" text ,
"whenCreated" text ,
PRIMARY KEY ("id")
)
CREATE TABLE "public"."WifiDevice" (
"id" SERIAL,
"oui" text ,
"mac" text NOT NULL ,
"hostname" text ,
"firstSeen" timestamp(3) ,
"lastSeen" timestamp(3) ,
"essid" text ,
"ip" text ,
"uptime" text ,
"apName" text ,
"status" "Status" ,
"createdAt" timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" timestamp(3) NOT NULL ,
"userId" integer ,
PRIMARY KEY ("id")
)
CREATE UNIQUE INDEX "ResetToken.token_unique" ON "public"."ResetToken"("token")
CREATE UNIQUE INDEX "User.sAMAccountName_unique" ON "public"."User"("sAMAccountName")
CREATE UNIQUE INDEX "WifiDevice.mac_unique" ON "public"."WifiDevice"("mac")
ALTER TABLE "public"."ResetToken" ADD FOREIGN KEY("userId")REFERENCES "public"."User"("id") ON DELETE CASCADE ON UPDATE CASCADE
ALTER TABLE "public"."ResetToken" ADD FOREIGN KEY("creatorId")REFERENCES "public"."User"("id") ON DELETE CASCADE ON UPDATE CASCADE
ALTER TABLE "public"."WifiDevice" ADD FOREIGN KEY("userId")REFERENCES "public"."User"("id") ON DELETE SET NULL ON UPDATE CASCADE
Changes
diff --git schema.prisma schema.prisma
migration ..20201110194349-init
--- datamodel.dml
+++ datamodel.dml
@@ -1,0 +1,95 @@
+generator client {
+ provider = "prisma-client-js"
+}
+
+datasource db {
+ provider = "postgresql"
+ url = "***"
+}
+
+model ResetToken {
+ id Int @id @default(autoincrement())
+ token String @unique
+ expiration DateTime
+ usedAt DateTime?
+ createdAt DateTime @default(now())
+ updatedAt DateTime @updatedAt
+ user User @relation(fields: [userId], references: [id], name: "resettoken_to_user")
+ userId Int
+ creator User @relation(fields: [creatorId], references: [id], name: "resettoken_to_creator")
+ creatorId Int
+}
+
+model User {
+ id Int @id @default(autoincrement())
+ lastLogin DateTime?
+ lastLoginPrior DateTime?
+ roles Json?
+ groups Json?
+ createdAt DateTime @default(now())
+ updatedAt DateTime @updatedAt
+ accountExpires String?
+ badPasswordTime String?
+ badPwdCount String?
+ cn String?
+ department String?
+ description String?
+ displayName String?
+ distinguishedName String?
+ dn String?
+ extensionAttribute1 String?
+ extensionAttribute10 String?
+ extensionAttribute2 String?
+ extensionAttribute6 String?
+ extensionAttribute7 String?
+ givenName String?
+ homeDirectory String?
+ homeDrive String?
+ lastLogoff String?
+ lastLogon String?
+ lastLogonTimestamp String?
+ lockoutTime String?
+ logonCount String?
+ mail String?
+ name String?
+ objectCategory String?
+ objectGUID String?
+ objectSid String?
+ primaryGroupID String?
+ pwdLastSet DateTime?
+ sAMAccountName String @unique
+ sAMAccountType String?
+ sn String?
+ thumbnailPhoto String?
+ title String?
+ userAccountControl String?
+ userPrincipalName String?
+ whenChanged String?
+ whenCreated String?
+ createdTokens ResetToken[] @relation("resettoken_to_user")
+ tokens ResetToken[] @relation("resettoken_to_creator")
+ WifiDevice WifiDevice[] @relation("wifidevice_to_user")
+}
+
+model WifiDevice {
+ id Int @id @default(autoincrement())
+ oui String?
+ mac String @unique
+ hostname String?
+ firstSeen DateTime?
+ lastSeen DateTime?
+ essid String?
+ ip String?
+ uptime String?
+ apName String?
+ status Status?
+ createdAt DateTime @default(now())
+ updatedAt DateTime @updatedAt
+ userId Int?
+ user User? @relation(fields: [userId], references: [id], name: "wifidevice_to_user")
+}
+
+enum Status {
+ ONLINE
+ OFFLINE
+}