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

schema:update always has updates #507

Closed
lookfirst opened this issue Apr 23, 2020 · 4 comments · Fixed by #508
Closed

schema:update always has updates #507

lookfirst opened this issue Apr 23, 2020 · 4 comments · Fixed by #508
Assignees
Labels
bug Something isn't working

Comments

@lookfirst
Copy link
Contributor

lookfirst commented Apr 23, 2020

Describe the bug
schema:update always has updates.

Tried rebuilding the cache and that didn't fix things.

Stack trace

NODE_ENV=proxy mikro-orm schema:update -r --fk-checks
Config environment: proxy
Schema successfully updated

NODE_ENV=proxy mikro-orm schema:update -d --fk-checks
Config environment: proxy
alter table "Person" drop constraint if exists "Person_displayName_check";
alter table "Person" alter column "displayName" type varchar using ("displayName"::varchar);
alter table "Person" alter column "displayName" set default null;
alter table "Person" drop constraint if exists "Person_photoURL_check";
alter table "Person" alter column "photoURL" type varchar using ("photoURL"::varchar);
alter table "Person" alter column "photoURL" set default null;

Expected behavior
Shouldn't see anything.

Versions

Dependency Version
mikro-orm 3.6.10
your-driver postgres
@lookfirst lookfirst added the bug Something isn't working label Apr 23, 2020
@lookfirst
Copy link
Contributor Author

fyi, removing default: null from:

	@Property({columnType: 'varchar', nullable: true})

Fixed it.

@B4nan
Copy link
Member

B4nan commented Apr 23, 2020

Did you really test this with 3.6.10? I see in the email you reported it on older version and there were fixes related to schema generator recently.

Anyway, i need to see entities, its not that simple (not happening always) - there are tests for this, and they pass. It might be also connected to the db version (not driver or connector, but the actual db).

@B4nan
Copy link
Member

B4nan commented Apr 23, 2020

Ok got it replicated, it's really because of the default: null (although it is not needed, as nullable columns already default to null, but agreed this should be covered).

@lookfirst
Copy link
Contributor Author

Yea, I went back and tested it after upgrading. =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants