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

Migrations for enum attributes are wrong #109

Closed
crunchtime-ali opened this issue Apr 26, 2016 · 3 comments
Closed

Migrations for enum attributes are wrong #109

crunchtime-ali opened this issue Apr 26, 2016 · 3 comments
Assignees
Labels
issue: bug Issue reporting a bug
Milestone

Comments

@crunchtime-ali
Copy link
Contributor

I've got this attribute in a model:

"state": {
    "type": "enum",
    "values": [
        "queued",
        "pending",
        "finished",
    ],
    "defaultTo": "queued"
}

Upon creating the migration this is created from its template:

table.enu('state', queued, pending, finished)
        .defaultTo('queued');

but it should be this:

table.enu('state', ['queued', 'pending', 'finished'])
        .defaultTo('queued');
@loicsaintroch loicsaintroch added issue: bug Issue reporting a bug framework labels Apr 26, 2016
@loicsaintroch loicsaintroch added this to the v2.0.0 milestone Apr 26, 2016
@loicsaintroch loicsaintroch self-assigned this Apr 26, 2016
@Aurelsicoko
Copy link
Member

@dj-hedgehog: Could you submit a PR for that?

@Aurelsicoko Aurelsicoko removed the knex label Aug 10, 2016
@crunchtime-ali
Copy link
Contributor Author

The migration-generation is completely broken (for me) currently. Every since @loicsaintroch generated working examples for the models I started with I wrote them by hand.

The question is how we want to deal with this? I'd like to try to fix migrations within the next weeks but bookshelf etc. needs to be put into its own plugin anyways. There are two problems:

a) I fix the strapi-generate-migrations BEFORE you put it into a new v3 plugin:
you have to wait for me to fix it first before you can do it

b) I fix the strapi-generate-migrations AFTER you put it into a new v3 plugin:
I'll probably need access to v3 so I can fix it.

Decide for yourself what you'd prefer.

@Aurelsicoko
Copy link
Member

strapi-bookshelf will not be a plugin. It already a hook available as strapi-mongoose in our new mono-repository structure (already available for the v2.0). As I said, I will publish the v3.0 asap. Before that, we have to migrate the repositories to another organisation because the wistityhq will no longer exist. You will be able to access to the strapi-generation-migrations and make PR on it. It has nothing to do with the plugins.

Do migrations are broken on the enum attribute only or on others things too?

alexandrebodin pushed a commit that referenced this issue Jul 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug Issue reporting a bug
Projects
None yet
Development

No branches or pull requests

4 participants