-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to migrate from version 1.7.4 to version 1.8.0 #6707
Comments
Could be bug in mssql migration |
@alexmejiaec could you try to upgrade to v1.7.6 and then upgrade to v1.8.0? |
@lunny I don't think that will help |
@lunny Did the try: 1.7.4 -> 1.7.6 -> 1.8.0 , not working 2019/04/23 08:47:58 [I] Log Mode: File(Info) Currently running on 1.7.6 |
My current configuration , if it helps APP_NAME = GIT NTS [security] [database] [repository] [server] [mailer] [service] [picture] [openid] [session] [log] [ui] [oauth2] |
The error with is_bare implies that migration 78 hasn't run properly. But that should have happened ages ago. Try setting the version in the version table to 78 to skip the migration. Drop the is_bare column by hand. |
Yup that worked, thanks BTW, the error is given because there's a constraint for is_bare that wasn't being dropped, thus not allowing renaming the column |
damn that's annoying. Fancy creating a PR for it? the file is Otherwise if you tell me the SQL I can add it to the file and try to create a PR. |
Actually I think there's a bit of a problem for that It looks like the constrait was created without a name, like :
So I had in my db a contraint with a SQL server generated name: DF__repositor__is_ba__1FCDBCEB The SQL required to drop that constraint was : But as the name of the constraint is system named I don't think you can add this in a migration I don't know if is related, but I also had to create is_empty column , as I checked the migration before and noticed that the info from is_bare was transfered to is_empty |
Ah that's why the migration didn't work for you. OK we're screwed in those cases and we will just have to cope with the issue reports I guess. OK, so you need to double check that repositories that are empty are marked with is_empty because unfortunately you'll get 500s if you try to access them. |
Is their currently a solution instead of manually do it. |
@Cellebyte Do you have the same issue as @alexmejiaec - is your constraint also autonamed? |
OK so the following SO comments discuss how to drop these constraints: https://stackoverflow.com/questions/670946/dropping-unnamed-constraints |
So i have the same Error Message as above in English.
I do not know how to fix that. |
@Cellebyte Try drop the column is_bare in repository table and check what error gives |
Or is the error message more specific on the DBMS than in ORM. |
This script can be used to drop the constraint without knowing the exact name DECLARE @ConstraintName VARCHAR(256)
DECLARE @SQL NVARCHAR(256)
SELECT @ConstraintName = obj.name FROM sys.columns col LEFT OUTER JOIN sys.objects obj ON obj.object_id = col.default_object_id AND obj.type = 'D' WHERE col.object_id = OBJECT_ID('repository') AND obj.name IS NOT NULL AND col.name = 'is_bare'
SET @SQL = N'ALTER TABLE [repository] DROP CONSTRAINT [' + @ConstraintName + N']'
EXEC sp_executesql @SQL |
Getting similar error when upgrading from 1.7.6 to 1.8.0. But the last line is different SQL Server 2014
|
The suggested workaround should work with SQL Server 2014, too. |
I think #6823 will fix this. It'll need to be backported to 1.8 |
Migration is now working thanks for the fix. |
[x]
):Description
Hi guys, I'm facing a issue when upgrading from version 1.74 to 1.8.0 :
2019/04/22 10:25:23 [I] Migration: add theme to users
2019/04/22 10:25:30 [I] Migration: rename repo is_bare to repo is_empty
2019/04/22 10:25:30 [I] Backing off for 3 seconds
2019/04/22 10:25:33 [I] ORM engine initialization attempt #2/10...
2019/04/22 10:25:33 [I] Migration: rename repo is_bare to repo is_empty
2019/04/22 10:25:34 [I] Backing off for 3 seconds
2019/04/22 10:25:37 [I] ORM engine initialization attempt #3/10...
2019/04/22 10:25:37 [I] Migration: rename repo is_bare to repo is_empty
2019/04/22 10:25:37 [I] Backing off for 3 seconds
2019/04/22 10:25:40 [I] ORM engine initialization attempt #4/10...
2019/04/22 10:25:40 [I] Migration: rename repo is_bare to repo is_empty
2019/04/22 10:25:40 [I] Backing off for 3 seconds
2019/04/22 10:25:44 [I] ORM engine initialization attempt #5/10...
2019/04/22 10:25:44 [I] Migration: rename repo is_bare to repo is_empty
2019/04/22 10:25:44 [I] Backing off for 3 seconds
2019/04/22 10:25:47 [I] ORM engine initialization attempt #6/10...
2019/04/22 10:25:47 [I] Migration: rename repo is_bare to repo is_empty
2019/04/22 10:25:47 [I] Backing off for 3 seconds
2019/04/22 10:25:50 [I] ORM engine initialization attempt #7/10...
2019/04/22 10:25:50 [I] Migration: rename repo is_bare to repo is_empty
2019/04/22 10:25:51 [I] Backing off for 3 seconds
2019/04/22 10:25:54 [I] ORM engine initialization attempt #8/10...
2019/04/22 10:25:54 [I] Migration: rename repo is_bare to repo is_empty
2019/04/22 10:25:54 [I] Backing off for 3 seconds
2019/04/22 10:25:57 [I] ORM engine initialization attempt #9/10...
2019/04/22 10:25:57 [I] Migration: rename repo is_bare to repo is_empty
2019/04/22 10:25:57 [I] Backing off for 3 seconds
2019/04/22 10:26:00 [I] ORM engine initialization attempt #10/10...
2019/04/22 10:26:00 [I] Migration: rename repo is_bare to repo is_empty
2019/04/22 10:26:01 [...itea/routers/init.go:82 GlobalInit()] [E] ORM engine initialization failed: migrate: do migrate: Drop column failed: mssql: Error de ALTER TABLE DROP COLUMN is_bare debido a que uno o más objetos tienen acceso a columna.
2019/04/22 10:26:22 [I] Log Mode: File(Info)
2019/04/22 10:26:22 [I] XORM Log Mode: File(Info)
2019/04/22 10:26:22 [I] Cache Service Enabled
2019/04/22 10:26:22 [I] Session Service Enabled
2019/04/22 10:26:22 [I] Mail Service Enabled
2019/04/22 10:26:22 [I] Notify Mail Service Enabled
2019/04/22 10:26:22 [I] Beginning ORM engine initialization.
2019/04/22 10:26:22 [I] ORM engine initialization attempt #1/10...
2019/04/22 10:26:22 [I] Migration: rename repo is_bare to repo is_empty
2019/04/22 10:26:29 [I] Backing off for 3 seconds
2019/04/22 10:26:32 [I] ORM engine initialization attempt #2/10...
2019/04/22 10:26:32 [I] Migration: rename repo is_bare to repo is_empty
2019/04/22 10:26:33 [I] Backing off for 3 seconds
2019/04/22 10:26:36 [I] ORM engine initialization attempt #3/10...
2019/04/22 10:26:36 [I] Migration: rename repo is_bare to repo is_empty
2019/04/22 10:26:36 [I] Backing off for 3 seconds
2019/04/22 10:26:39 [I] ORM engine initialization attempt #4/10...
2019/04/22 10:26:39 [I] Migration: rename repo is_bare to repo is_empty
2019/04/22 10:26:39 [I] Backing off for 3 seconds
2019/04/22 10:26:42 [I] ORM engine initialization attempt #5/10...
2019/04/22 10:26:43 [I] Migration: rename repo is_bare to repo is_empty
2019/04/22 10:26:43 [I] Backing off for 3 seconds
2019/04/22 10:26:46 [I] ORM engine initialization attempt #6/10...
2019/04/22 10:26:46 [I] Migration: rename repo is_bare to repo is_empty
2019/04/22 10:26:46 [I] Backing off for 3 seconds
2019/04/22 10:26:49 [I] ORM engine initialization attempt #7/10...
2019/04/22 10:26:49 [I] Migration: rename repo is_bare to repo is_empty
2019/04/22 10:26:50 [I] Backing off for 3 seconds
2019/04/22 10:26:53 [I] ORM engine initialization attempt #8/10...
2019/04/22 10:26:53 [I] Migration: rename repo is_bare to repo is_empty
2019/04/22 10:26:54 [I] Backing off for 3 seconds
2019/04/22 10:26:57 [I] ORM engine initialization attempt #9/10...
2019/04/22 10:26:57 [I] Migration: rename repo is_bare to repo is_empty
2019/04/22 10:26:57 [I] Backing off for 3 seconds
2019/04/22 10:27:00 [I] ORM engine initialization attempt #10/10...
2019/04/22 10:27:00 [I] Migration: rename repo is_bare to repo is_empty
2019/04/22 10:27:01 [...itea/routers/init.go:82 GlobalInit()] [E] ORM engine initialization failed: migrate: do migrate: Drop column failed: mssql: Error de ALTER TABLE DROP COLUMN is_bare debido a que uno o más objetos tienen acceso a columna.
Do you have any solution or workaround for this?
The text was updated successfully, but these errors were encountered: