From cd8ac177752ce1b886d594a020f0dc7c6303674a Mon Sep 17 00:00:00 2001 From: Ross Trottier Date: Fri, 24 May 2024 20:12:40 -0600 Subject: [PATCH] fixed bug with creating image results table --- main.go | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/main.go b/main.go index 411b8a0..d4402b1 100644 --- a/main.go +++ b/main.go @@ -15,7 +15,7 @@ const wordpressSecret = "6zY7 xsKZ dGIt l1Lp ypIK 6TWh" const slowtwitchAdminUser = "admin" const slowtwitchAdminPass = "yxnh93Ybbz2Nm8#mp28zCVv" const slowtwitchDbName = "slowtwitch" -const migrationDbName = "slowtwitch_transfer" +const migrationDbName = "slowtwitch_transfer_threaded_test" const federatedDbUrl = "slowtwitch.northend.network" const federatedDbPort = "3306" @@ -72,22 +72,6 @@ func connectToDatabases() { panic("Could not create category results table.") } - createImageResultsTableSQL := ` - create table if not exists ImageResults( - Id int primary key not null auto_increment, - PostId int null, - WordpressId int not null, - OldUrl nvarchar(500) not null, - NewUrl nvarchar(500), - IsSuccess BIT not null, - ErrorMessage nvarchar(1500), - foreign key (PostId) references PostResults(Id) - );` - _, createImageResultsTableErr := resultsDB.Exec(createImageResultsTableSQL) - if createImageResultsTableErr != nil { - panic("Could not create image results table.") - } - createPostsResultsTableSQL := ` create table if not exists PostResults( Id int primary key not null auto_increment, @@ -103,6 +87,22 @@ func connectToDatabases() { if createPostsResultsTableErr != nil { panic("Could not create post results table.") } + + createImageResultsTableSQL := ` + create table if not exists ImageResults( + Id int primary key not null auto_increment, + PostId int null, + WordpressId int not null, + OldUrl nvarchar(500) not null, + NewUrl nvarchar(500), + IsSuccess BIT not null, + ErrorMessage nvarchar(1500), + foreign key (PostId) references PostResults(Id) + );` + _, createImageResultsTableErr := resultsDB.Exec(createImageResultsTableSQL) + if createImageResultsTableErr != nil { + panic("Could not create image results table.") + } } func migrateAuthors() {