fixed bug with creating image results table
This commit is contained in:
parent
48ff48884b
commit
cd8ac17775
34
main.go
34
main.go
@ -15,7 +15,7 @@ const wordpressSecret = "6zY7 xsKZ dGIt l1Lp ypIK 6TWh"
|
|||||||
const slowtwitchAdminUser = "admin"
|
const slowtwitchAdminUser = "admin"
|
||||||
const slowtwitchAdminPass = "yxnh93Ybbz2Nm8#mp28zCVv"
|
const slowtwitchAdminPass = "yxnh93Ybbz2Nm8#mp28zCVv"
|
||||||
const slowtwitchDbName = "slowtwitch"
|
const slowtwitchDbName = "slowtwitch"
|
||||||
const migrationDbName = "slowtwitch_transfer"
|
const migrationDbName = "slowtwitch_transfer_threaded_test"
|
||||||
const federatedDbUrl = "slowtwitch.northend.network"
|
const federatedDbUrl = "slowtwitch.northend.network"
|
||||||
const federatedDbPort = "3306"
|
const federatedDbPort = "3306"
|
||||||
|
|
||||||
@ -72,22 +72,6 @@ func connectToDatabases() {
|
|||||||
panic("Could not create category results table.")
|
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 := `
|
createPostsResultsTableSQL := `
|
||||||
create table if not exists PostResults(
|
create table if not exists PostResults(
|
||||||
Id int primary key not null auto_increment,
|
Id int primary key not null auto_increment,
|
||||||
@ -103,6 +87,22 @@ func connectToDatabases() {
|
|||||||
if createPostsResultsTableErr != nil {
|
if createPostsResultsTableErr != nil {
|
||||||
panic("Could not create post results table.")
|
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() {
|
func migrateAuthors() {
|
||||||
|
Loading…
Reference in New Issue
Block a user