Skip to content
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

Running migrations on MS SQL db tries to create the migrations table on every run #1254

Closed
kenpederson opened this issue Nov 28, 2017 · 5 comments
Labels

Comments

@kenpederson
Copy link

I am trying to use typeorm as the orm for my node project. When I run my initial sync, all of my tables are created fine. I then create a migration and run it without issue (table updates made, migration table created, migration entry added). Now I am trying to run a second migration and I am receiving the following error:

QueryFailedError: RequestThere is already an object named 'migrations' in the database.

Why is typeorm trying to create the migration table again if it already exists from being created during the last migration? I am guessing there is a bug in the createMigrationsTableIfNotExist function of the MigrationExecutor?

@pleerock
Copy link
Member

Looks like its a mssql-specific bug. I'll publish 0.1.7 with the fix today.

pleerock pushed a commit that referenced this issue Nov 29, 2017
pleerock pushed a commit that referenced this issue Dec 1, 2017
* master:
  fixed tslint error
  removed only test
  fixes #1270
  webpack: enable usage in node projects by not automatically selecting browser version
  updated changelog
  fixes #1241
  driver(cordova): support extra options
  remove only
  added tests for #1261
  fixes #1259
  fixes #1259
  fixes #1254; version bump
  fixes #1254

# Conflicts:
#	CHANGELOG.md
#	package.json
#	src/entity-manager/EntityManager.ts
@PJCAfonso
Copy link

Hi
TypeOrm really has helped speed up my development, you guys are doing a great job, but you that used Django up to now, are feeling some problems with migrations, because there all stuff of changes on code versus database, implement the scripts very well.

We are using TYPEORM 0.2.9 and MSSQL 4.2.3. All the changes we made over entity files, typeorm migration try all the time create a new table. Since add new column, change name of column, add new relations, etc, etc,

We are analised this and we are worry because when our platform go to market, and few month later we want to implement new feature, how can we update all update on database?

Please tell us, "we are doing migrations wrong!", and we do not need to manually write all changes we do on code versus database?

Once again guys greate tool.

@havenchyk
Copy link
Contributor

@PJCAfonso could you please create a new issue with some example?

@PJCAfonso
Copy link

Hi
TypeOrm really has helped speed up my development, you guys are doing a great job, but you that used Django up to now, are feeling some problems with migrations, because there all stuff of changes on code versus database, implement the scripts very well.

We are using TYPEORM 0.2.9 and MSSQL 4.2.3. All the changes we made over entity files, typeorm migration try all the time create a new table. Since add new column, change name of column, add new relations, etc, etc,

We are analised this and we are worry because when our platform go to market, and few month later we want to implement new feature, how can we update all update on database?

Please tell us, "we are doing migrations wrong!", and we do not need to manually write all changes we do on code versus database?

Once again guys greate tool.

We open new issue here #3164
can close this!

@osnersanchez
Copy link

I am having this same problem when generating a second migration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants