mirror of
https://github.com/EdiFarcas/Car-Fuel-Tracking-App.git
synced 2026-06-29 07:00:51 +03:00
Hybrid cars implementation 1.0(Without stats)
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- You are about to drop the column `fuelType` on the `Car` table. All the data in the column will be lost.
|
||||
- Added the required column `fuelType` to the `FillUp` table without a default value. This is not possible if the table is not empty.
|
||||
*/
|
||||
-- AlterTable
|
||||
ALTER TABLE "Car" DROP COLUMN "fuelType",
|
||||
ADD COLUMN "fuelTypes" "FuelType"[];
|
||||
|
||||
-- AlterTable: add as nullable first
|
||||
ALTER TABLE "FillUp" ADD COLUMN "fuelType" "FuelType";
|
||||
|
||||
-- Set default for existing rows (choose the most common, e.g. GASOLINE)
|
||||
UPDATE "FillUp" SET "fuelType" = 'GASOLINE' WHERE "fuelType" IS NULL;
|
||||
|
||||
-- Make the column required
|
||||
ALTER TABLE "FillUp" ALTER COLUMN "fuelType" SET NOT NULL;
|
||||
Reference in New Issue
Block a user