Migrate: [ Migration ] Data Loss

Created on 26 Feb 2020  ·  2Comments  ·  Source: prisma/migrate

Prisma Version: [email protected], binary version: d20d1e6b1525ae45e3cc39784ad16c97d463f61c
Database: Postgres

Steps

  1. prisma2 introspect
  2. prisma2 generate
  3. prisma2 migrate save --experimental
  4. prisma2 migrate up --experimental ⚠️ There will be data loss
⚠️  There will be data loss:

  • You are about to alter the column `operator` on the `FlightCharterOperatorYear` table, which still contains 4 non-null values. The data in that column will be lost.
  • You are about to alter the column `operator` on the `FlightOperatorYear` table, which still contains 9 non-null values. The data in that column will be lost.
  • You are about to alter the column `season` on the `FlightRoute` table, which still contains 124 non-null values. The data in that column will be lost.
  • You are about to alter the column `chatRoom` on the `Message` table, which still contains 47 non-null values. The data in that column will be lost.
  • You are about to alter the column `sentBy` on the `Message` table, which still contains 47 non-null values. The data in that column will be lost.
  • You are about to alter the column `operator` on the `Plane` table, which still contains 3 non-null values. The data in that column will be lost.
  • You are about to alter the column `quoteProperty` on the `QuoteAccommodation` table, which still contains 34 non-null values. The data in that column will be lost.
  • You are about to alter the column `quote` on the `QuoteCustomItem` table, which still contains 17 non-null values. The data in that column will be lost.
  • You are about to alter the column `type` on the `QuoteCustomItem` table, which still contains 17 non-null values. The data in that column will be lost.
  • You are about to alter the column `rateGroup` on the `RateGroupOverride` table, which still contains 21 non-null values. The data in that column will be lost.
  • You are about to alter the column `season` on the `RateGroupOverride` table, which still contains 21 non-null values. The data in that column will be lost.
  • You are about to alter the column `country` on the `Region` table, which still contains 2780 non-null values. The data in that column will be lost.
  • You are about to alter the column `transfer` on the `TransferRate` table, which still contains 30 non-null values. The data in that column will be lost.
  • You are about to alter the column `paymentStatus` on the `Trip` table, which still contains 10 non-null values. The data in that column will be lost.
  • You are about to alter the column `status` on the `Trip` table, which still contains 10 non-null values. The data in that column will be lost.
  • You are about to alter the column `userType` on the `User` table, which still contains 93 non-null values. The data in that column will be lost.
  • You are about to drop the table `_DateRangeToFlightOperatorSeason`, which is not empty (24 rows).
  • You are about to drop the table `_DateRangeToPropertySeason`, which is not empty (1077 rows).
  • You are about to drop the table `_DateRangeToPropertySpecial`, which is not empty (3 rows).
  • You are about to drop the table `_FlightCharterRateToPlane`, which is not empty (2 rows).
  • You are about to drop the table `_FlightRouteToQuoteFlightRoute`, which is not empty (11 rows).
  • You are about to drop the table `_GPSCoordToPropertyAccess`, which is not empty (211 rows).
  • You are about to drop the table `_InsuranceCompanyToUserTravelInfo`, which is not empty (9 rows).
  • You are about to drop the table `_MeetAndGreetOperatorRateToQuoteArrivalDeparture`, which is not empty (2 rows).
  • You are about to drop the table `_PrimaryMeetAndGreetOperatorOnAirport`, which is not empty (1 rows).
  • You are about to drop the table `Property_exclusions`, which is not empty (110 rows).
  • You are about to drop the table `PropertyExtra_notes`, which is not empty (2 rows).
  • You are about to drop the table `_PropertyInclusionBasicToPropertyRateGroup`, which is not empty (854 rows).
  • You are about to drop the table `_PropertyInclusionDrinkToPropertyRateGroup`, which is not empty (854 rows).
  • You are about to drop the table `Property_inclusions`, which is not empty (147 rows).
  • You are about to drop the table `_PropertyPackageRateGroupToPropertyRateGroup`, which is not empty (630 rows).
  • You are about to drop the table `_PropertyPackageRateGroupToRoomUnitCost`, which is not empty (599 rows).
  • You are about to drop the table `_PropertyPageOnProperty`, which is not empty (4 rows).
  • You are about to drop the table `_PropertyRateGroupToRoomRate`, which is not empty (2772 rows).
  • You are about to drop the table `_PropertySeasonToQuoteAccommodation`, which is not empty (33 rows).
  • You are about to drop the table `_PropertySeasonToRoomRate`, which is not empty (2744 rows).
  • You are about to drop the table `_PropertySeasonToRoomUnitCost`, which is not empty (493 rows).
  • You are about to drop the table `PropertySpecial_notes`, which is not empty (1 rows).
  • You are about to drop the table `_PropertyToPropertyAccess`, which is not empty (201 rows).
  • You are about to drop the table `QuoteAccommodation_notes`, which is not empty (1 rows).
  • You are about to drop the table `_QuoteAccommodationPaxToRoomRate`, which is not empty (40 rows).
  • You are about to drop the table `_QuoteAccommodationToRoom`, which is not empty (34 rows).
  • You are about to drop the table `_QuoteTransferToTransferRate`, which is not empty (18 rows).
  • You are about to drop the table `_TransferRateToTransferVehicle`, which is not empty (30 rows).
  • You are about to drop the table `_UserOnUserAuth`, which is not empty (11 rows).
  • You are about to drop the table `_UserOnUserBasicInfo`, which is not empty (93 rows).
  • You are about to drop the table `_UserOnUserTravelInfo`, which is not empty (18 rows).
bu0-needs-info kinbug

Most helpful comment

@pantharshit00 Just tested with preview024 and there doesn't seem to be an issue.

All 2 comments

Hi @williamluke4

Sorry for the late reply here 🙏. This had gone out of my radar

Can you please try this again with preview024? I tried to migrate your schema and it works but I also have no data in the database. Your database is pretty large and it is not that easy seed by hand

Let me know if it works otherwise I will spend time in manually speeding the database and trying for proper reproduction.

@pantharshit00 Just tested with preview024 and there doesn't seem to be an issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

julien1619 picture julien1619  ·  3Comments

chanphiromsok picture chanphiromsok  ·  3Comments

hamidb80 picture hamidb80  ·  4Comments

ff-anthony-soto picture ff-anthony-soto  ·  3Comments

jwld picture jwld  ·  3Comments