diff --git a/store/datastore/ddl/mysql/ddl_gen.go b/store/datastore/ddl/mysql/ddl_gen.go index 4d4048f6f..a4c959759 100644 --- a/store/datastore/ddl/mysql/ddl_gen.go +++ b/store/datastore/ddl/mysql/ddl_gen.go @@ -188,6 +188,10 @@ var migrations = []struct { name: "update-table-set-repo-fallback", stmt: updateTableSetRepoFallback, }, + { + name: "update-table-set-repo-fallback-again", + stmt: updateTableSetRepoFallbackAgain, + }, } // Migrate performs the database migration. If the migration fails @@ -713,3 +717,11 @@ ALTER TABLE repos ADD COLUMN repo_fallback BOOLEAN var updateTableSetRepoFallback = ` UPDATE repos SET repo_fallback='false' ` + +// +// 024_add_repo_fallback_column.sql +// + +var updateTableSetRepoFallbackAgain = ` +UPDATE repos SET repo_fallback='false' +` diff --git a/store/datastore/ddl/mysql/files/024_add_repo_fallback_column.sql b/store/datastore/ddl/mysql/files/024_add_repo_fallback_column.sql new file mode 100644 index 000000000..0a663b4e1 --- /dev/null +++ b/store/datastore/ddl/mysql/files/024_add_repo_fallback_column.sql @@ -0,0 +1,2 @@ +-- name: update-table-set-repo-fallback-again +UPDATE repos SET repo_fallback='false' diff --git a/store/datastore/ddl/postgres/ddl_gen.go b/store/datastore/ddl/postgres/ddl_gen.go index c55674bb9..32fe66ad3 100644 --- a/store/datastore/ddl/postgres/ddl_gen.go +++ b/store/datastore/ddl/postgres/ddl_gen.go @@ -188,6 +188,10 @@ var migrations = []struct { name: "update-table-set-repo-fallback", stmt: updateTableSetRepoFallback, }, + { + name: "update-table-set-repo-fallback-again", + stmt: updateTableSetRepoFallbackAgain, + }, } // Migrate performs the database migration. If the migration fails @@ -715,3 +719,11 @@ ALTER TABLE repos ADD COLUMN repo_fallback BOOLEAN var updateTableSetRepoFallback = ` UPDATE repos SET repo_fallback='false' ` + +// +// 024_add_repo_fallback_column.sql +// + +var updateTableSetRepoFallbackAgain = ` +UPDATE repos SET repo_fallback='false' +` diff --git a/store/datastore/ddl/postgres/files/024_add_repo_fallback_column.sql b/store/datastore/ddl/postgres/files/024_add_repo_fallback_column.sql new file mode 100644 index 000000000..0a663b4e1 --- /dev/null +++ b/store/datastore/ddl/postgres/files/024_add_repo_fallback_column.sql @@ -0,0 +1,2 @@ +-- name: update-table-set-repo-fallback-again +UPDATE repos SET repo_fallback='false' diff --git a/store/datastore/ddl/sqlite/ddl_gen.go b/store/datastore/ddl/sqlite/ddl_gen.go index d5fe8eb5c..ba26a47bf 100644 --- a/store/datastore/ddl/sqlite/ddl_gen.go +++ b/store/datastore/ddl/sqlite/ddl_gen.go @@ -192,6 +192,10 @@ var migrations = []struct { name: "update-table-set-repo-fallback", stmt: updateTableSetRepoFallback, }, + { + name: "update-table-set-repo-fallback-again", + stmt: updateTableSetRepoFallbackAgain, + }, } // Migrate performs the database migration. If the migration fails @@ -714,3 +718,11 @@ ALTER TABLE repos ADD COLUMN repo_fallback BOOLEAN var updateTableSetRepoFallback = ` UPDATE repos SET repo_fallback='false' ` + +// +// 024_add_repo_fallback_column.sql +// + +var updateTableSetRepoFallbackAgain = ` +UPDATE repos SET repo_fallback='false' +` diff --git a/store/datastore/ddl/sqlite/files/024_add_repo_fallback_column.sql b/store/datastore/ddl/sqlite/files/024_add_repo_fallback_column.sql new file mode 100644 index 000000000..0a663b4e1 --- /dev/null +++ b/store/datastore/ddl/sqlite/files/024_add_repo_fallback_column.sql @@ -0,0 +1,2 @@ +-- name: update-table-set-repo-fallback-again +UPDATE repos SET repo_fallback='false' diff --git a/store/datastore/repos.go b/store/datastore/repos.go index 0f187c993..eef5a4b9d 100644 --- a/store/datastore/repos.go +++ b/store/datastore/repos.go @@ -93,6 +93,7 @@ func (db *datastore) RepoBatch(repos []*model.Repo) error { repo.IsGated, repo.Visibility, repo.Counter, + repo.Fallback, ) if err != nil { return err diff --git a/store/datastore/sql/mysql/files/repos.sql b/store/datastore/sql/mysql/files/repos.sql index 5459fc6b5..e738601cf 100644 --- a/store/datastore/sql/mysql/files/repos.sql +++ b/store/datastore/sql/mysql/files/repos.sql @@ -30,6 +30,7 @@ SELECT ,repo_gated ,repo_visibility ,repo_counter +,repo_fallback FROM repos INNER JOIN perms ON perms.perm_repo_id = repos.repo_id WHERE perms.perm_user_id = ? @@ -60,7 +61,8 @@ INSERT IGNORE INTO repos ( ,repo_gated ,repo_visibility ,repo_counter -) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) +,repo_fallback +) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) -- name: repo-delete diff --git a/store/datastore/sql/mysql/sql_gen.go b/store/datastore/sql/mysql/sql_gen.go index 73990a460..d047d2471 100644 --- a/store/datastore/sql/mysql/sql_gen.go +++ b/store/datastore/sql/mysql/sql_gen.go @@ -448,6 +448,7 @@ SELECT ,repo_gated ,repo_visibility ,repo_counter +,repo_fallback FROM repos INNER JOIN perms ON perms.perm_repo_id = repos.repo_id WHERE perms.perm_user_id = ? @@ -478,7 +479,8 @@ INSERT IGNORE INTO repos ( ,repo_gated ,repo_visibility ,repo_counter -) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) +,repo_fallback +) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) ` var repoDelete = ` diff --git a/store/datastore/sql/postgres/files/repos.sql b/store/datastore/sql/postgres/files/repos.sql index 6c0eb1445..85eb37ace 100644 --- a/store/datastore/sql/postgres/files/repos.sql +++ b/store/datastore/sql/postgres/files/repos.sql @@ -30,6 +30,7 @@ SELECT ,repo_gated ,repo_visibility ,repo_counter +,repo_fallback FROM repos INNER JOIN perms ON perms.perm_repo_id = repos.repo_id WHERE perms.perm_user_id = $1 @@ -60,7 +61,8 @@ INSERT INTO repos ( ,repo_gated ,repo_visibility ,repo_counter -) VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22) +,repo_fallback +) VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23) ON CONFLICT (repo_full_name) DO NOTHING -- name: repo-delete diff --git a/store/datastore/sql/postgres/sql_gen.go b/store/datastore/sql/postgres/sql_gen.go index 84eb1df9a..502306ced 100644 --- a/store/datastore/sql/postgres/sql_gen.go +++ b/store/datastore/sql/postgres/sql_gen.go @@ -451,6 +451,7 @@ SELECT ,repo_gated ,repo_visibility ,repo_counter +,repo_fallback FROM repos INNER JOIN perms ON perms.perm_repo_id = repos.repo_id WHERE perms.perm_user_id = $1 @@ -481,7 +482,8 @@ INSERT INTO repos ( ,repo_gated ,repo_visibility ,repo_counter -) VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22) +,repo_fallback +) VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23) ON CONFLICT (repo_full_name) DO NOTHING ` diff --git a/store/datastore/sql/sqlite/files/repos.sql b/store/datastore/sql/sqlite/files/repos.sql index 2aba7acf6..8ae397f46 100644 --- a/store/datastore/sql/sqlite/files/repos.sql +++ b/store/datastore/sql/sqlite/files/repos.sql @@ -30,6 +30,7 @@ SELECT ,repo_gated ,repo_visibility ,repo_counter +,repo_fallback FROM repos INNER JOIN perms ON perms.perm_repo_id = repos.repo_id WHERE perms.perm_user_id = ? @@ -60,7 +61,8 @@ INSERT OR IGNORE INTO repos ( ,repo_gated ,repo_visibility ,repo_counter -) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) +,repo_fallback +) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) -- name: repo-delete diff --git a/store/datastore/sql/sqlite/sql_gen.go b/store/datastore/sql/sqlite/sql_gen.go index 08a2c1b43..0a57e3e02 100644 --- a/store/datastore/sql/sqlite/sql_gen.go +++ b/store/datastore/sql/sqlite/sql_gen.go @@ -448,6 +448,7 @@ SELECT ,repo_gated ,repo_visibility ,repo_counter +,repo_fallback FROM repos INNER JOIN perms ON perms.perm_repo_id = repos.repo_id WHERE perms.perm_user_id = ? @@ -478,7 +479,8 @@ INSERT OR IGNORE INTO repos ( ,repo_gated ,repo_visibility ,repo_counter -) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) +,repo_fallback +) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) ` var repoDelete = `