You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from my initial discord post.
Just tried 1.15-rc2 windows go-git version and it fails to start, with sql errors during migration.
We're using SQL 2008 R2 which doesn't support IF EXISTS option.
2021/07/29 11:33:53 ...ations/migrations.go:49:Migrate() [I] [SQL] ALTER TABLE [hook_task] DROP CONSTRAINT IF EXISTS [IDX_tmp_recreatehook_task_typ] []
2021/07/29 11:33:53 ...ations/migrations.go:422:Migrate() [I] [SQL] ROLLBACK [] - 504.6µs
2021/07/29 11:33:53 routers/init.go: 100:GlobalInit() [F] ORM engine initialization failed: migrate: do migrate: Drop table hook_task index constraint `IDX_tmp_recreatehook_task_typ`: mssql: Incorrect syntax near the keyword 'IF'
The text was updated successfully, but these errors were encountered:
Having a look at /models/migrations/migrations.go#L854, it looks to me that the code is looking up the names of constraints that need to be dropped, making the 'IF EXISTS' clause on lines 861 & 864 redundant?
zeripath
changed the title
Failed attempt to migrate to 1.15-rc2 windows go-git version
Failed attempt to migrate to 1.15-rc2 windows SQL Server 2008 R2 sp3
Aug 5, 2021
The if exists here is belt and braces - it could be dropped.
The main issue is that we can't test against such very old versions of SQL Server. It's difficult enough to write migrations that SQL server will accept at the best of times.
From the transact SQL documentation:
IF EXISTS
Applies to: SQL Server (SQL Server 2016 (13.x) and later) and Azure SQL Database.
I guess the way to proceed in this case is to adjust this migration to not use IF EXISTS but we need to decide what is the oldest version of SQL server we support.
(For example I don't think we can support versions that don't even have SYS.INDEXES - I think this is sub 2000! Although if users in this case were willing to provide alternative SQL we could use it.)
[x]
):Description
from my initial discord post.
Just tried 1.15-rc2 windows go-git version and it fails to start, with sql errors during migration.
We're using SQL 2008 R2 which doesn't support IF EXISTS option.
The text was updated successfully, but these errors were encountered: