feat: migrate legacy long-lived database records
This commit is contained in:
@@ -670,9 +670,10 @@ export const createDatabaseTurnHooks = async (
|
||||
deletedNationSnapshots.map((snapshot) =>
|
||||
prisma.oldNation.upsert({
|
||||
where: {
|
||||
serverId_nation: {
|
||||
serverId_nation_sourceId: {
|
||||
serverId,
|
||||
nation: snapshot.nation.id,
|
||||
sourceId: 0,
|
||||
},
|
||||
},
|
||||
update: {
|
||||
@@ -695,6 +696,7 @@ export const createDatabaseTurnHooks = async (
|
||||
create: {
|
||||
serverId,
|
||||
nation: snapshot.nation.id,
|
||||
sourceId: 0,
|
||||
data: {
|
||||
nation: snapshot.nation.id,
|
||||
name: snapshot.nation.name,
|
||||
|
||||
@@ -558,9 +558,10 @@ export const createUnificationHandler = (options: {
|
||||
|
||||
await prisma.oldNation.upsert({
|
||||
where: {
|
||||
serverId_nation: {
|
||||
serverId_nation_sourceId: {
|
||||
serverId,
|
||||
nation: winnerNationId,
|
||||
sourceId: 0,
|
||||
},
|
||||
},
|
||||
update: {
|
||||
@@ -583,6 +584,7 @@ export const createUnificationHandler = (options: {
|
||||
create: {
|
||||
serverId,
|
||||
nation: winnerNationId,
|
||||
sourceId: 0,
|
||||
data: {
|
||||
nation: winnerNationId,
|
||||
name: winnerNation.name,
|
||||
@@ -602,9 +604,10 @@ export const createUnificationHandler = (options: {
|
||||
|
||||
await prisma.oldNation.upsert({
|
||||
where: {
|
||||
serverId_nation: {
|
||||
serverId_nation_sourceId: {
|
||||
serverId,
|
||||
nation: 0,
|
||||
sourceId: 0,
|
||||
},
|
||||
},
|
||||
update: {
|
||||
@@ -627,6 +630,7 @@ export const createUnificationHandler = (options: {
|
||||
create: {
|
||||
serverId,
|
||||
nation: 0,
|
||||
sourceId: 0,
|
||||
data: {
|
||||
nation: 0,
|
||||
name: '재야',
|
||||
|
||||
@@ -160,10 +160,11 @@ export const createYearbookHandler = (options: {
|
||||
|
||||
await connector.prisma.yearbookHistory.upsert({
|
||||
where: {
|
||||
profileName_year_month: {
|
||||
profileName_year_month_sourceId: {
|
||||
profileName: options.profileName,
|
||||
year: context.previousYear,
|
||||
month: context.previousMonth,
|
||||
sourceId: 0,
|
||||
},
|
||||
},
|
||||
update: {
|
||||
@@ -173,6 +174,7 @@ export const createYearbookHandler = (options: {
|
||||
},
|
||||
create: {
|
||||
profileName: options.profileName,
|
||||
sourceId: 0,
|
||||
year: context.previousYear,
|
||||
month: context.previousMonth,
|
||||
map,
|
||||
|
||||
Reference in New Issue
Block a user