inlightmedia
08/19/2021, 8:47 PMBookingToModeratorParticipant (Relation)
- The id column `id` in link table `_BookingToModeratorParticipant` has been removed.
It was a Prisma legacy column that is not in use anymore.
Applying changes... (0/252)
Applying changes... (33/252)
Applying changes... (87/252)
Applying changes... (102/252)
Applying changes... (121/252)
Applying changes... 26.0s
��� The Migration failed and has not been performed. This is very likely not a
��� transient issue.
��� org.postgresql.util.PSQLException: ERROR: column "id" of relation
��� "_NotificationParamsToPurchasedService" does not exist
After migrating from the old datamodel in prisma1@1.30.5 to prisma1@1.34.12 I’m getting this error. I have verified in psql that the ids for all relations are in fact gone. So, the deploy did work the first time (and there were no errors the first time I deployed). So, I’m not sure why prisma now shows this id column removal notice for every relation and then subsequent error stating that it can’t find the id column on one of them. I’m not querying the id column of any relation anywhere explicitly.
This happens on every prisma deploy when my app starts now.
Any ideas?inlightmedia
08/20/2021, 1:57 PMinlightmedia
08/20/2021, 2:01 PMinlightmedia
08/22/2021, 6:43 AMinlightmedia
08/23/2021, 3:35 PMinlightmedia
08/23/2021, 3:41 PM{"key":"error/handled","requestId":"local:cksosu6qv008a0e031mr4sxep","payload":{"exception":"com.prisma.deploy.schema.InvalidToken: Authentication token is invalid: 'Authorization' header not provided","query":"{\n listProjects {\n name\n }\n
[Debug] Initializing deployment worker for api$stag
[Debug] Scheduling deployment for project api$stag
Encountered exception while applying migration. Rolling back. org.postgresql.util.PSQLException: ERROR: column "id" of relation "_NotificationParamsToPurchasedService" does not exist
org.postgresql.util.PSQLException: ERROR: column "id" of relation "_NotificationParamsToPurchasedService" does not exist
My prisma compose config includes the management api secret and so do the environments for prisma and my server container. I’ve had this working for years with the same api management secret. The only difference now is the new datamodel. How could updating the datamodel invalidate my management api secret?inlightmedia
08/23/2021, 3:52 PMinlightmedia
08/23/2021, 4:18 PMinlightmedia
08/24/2021, 9:34 PMALTER TABLE "example$example"."_ExampleToOtherExample" DROP COLUMN "id"
when it should be running:
ALTER TABLE "example$example"."_ExampleToOtherExample" DROP COLUMN IF EXISTS "id"
This prevents errors from being thrown if it already deleted something.inlightmedia
08/25/2021, 1:58 AMdef addOrRemoveIdColumn(project: Project, previousRelation: Relation, nextRelation: Relation): DBIO[_] = {
(previousRelation.idColumn, nextRelation.idColumn) match {
case (Some(idColumn), None) => deleteColumn(project, previousRelation.relationTableName, idColumn)
case (None, Some(idColumn)) =>
// We are not adding a primary key column because we don't need it actually.
// Because of the default this column will also work if the insert does not contain the id column.
val query = sql.alterTable(name(project.dbName, previousRelation.relationTableName)).addColumn(field(s""""#$idColumn" varchar(40) default null"""))
changeDatabaseQueryToDBIO(query)()
case _ => DBIO.successful(())
}
}
However, it looks like it should be resilient to columns not existing.inlightmedia
08/26/2021, 1:50 PM