fix: add firstName and lastName to user model (#473)
* fix: add firstname and lastanme to user model * fix: avoid undefined in displayName resolve field * fix: user firstName and lastName instead of firstname lastname * fix: person table proper naming firstName lastName * fix: migrate front with firstName and lastName * fix: make front-graphql-generate not working
This commit is contained in:
@ -0,0 +1,11 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- Added the required column `firstName` to the `users` table without a default value. This is not possible if the table is not empty.
|
||||
- Added the required column `lastName` to the `users` table without a default value. This is not possible if the table is not empty.
|
||||
|
||||
*/
|
||||
-- AlterTable
|
||||
ALTER TABLE "users" ADD COLUMN "firstName" TEXT NOT NULL DEFAULT '',
|
||||
ADD COLUMN "lastName" TEXT NOT NULL DEFAULT '',
|
||||
ALTER COLUMN "displayName" DROP NOT NULL;
|
||||
@ -0,0 +1,19 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "people"
|
||||
ADD COLUMN "firstName" TEXT,
|
||||
ADD COLUMN "lastName" TEXT;
|
||||
|
||||
-- Update new columns using old columns
|
||||
UPDATE "people"
|
||||
SET "firstName" = "firstname",
|
||||
"lastName" = "lastname";
|
||||
|
||||
-- Drop old columns
|
||||
ALTER TABLE "people"
|
||||
DROP COLUMN "firstname",
|
||||
DROP COLUMN "lastname";
|
||||
|
||||
-- Make new columns NOT NULL
|
||||
ALTER TABLE "people"
|
||||
ALTER COLUMN "firstName" SET NOT NULL,
|
||||
ALTER COLUMN "lastName" SET NOT NULL;
|
||||
Reference in New Issue
Block a user