Cli: Where is documentation for creating references in migrations?

Created on 15 Feb 2016  路  4Comments  路  Source: sequelize/cli

I need to create migrations that define references between tables.

I see posts and threads of people discussing it and providing a bit of syntax but I can't find the documentation for it anywhere. Not even on http://docs.sequelizejs.com/en/latest/docs/migrations/

Am I just missing something obvious here? Where is it?

docs

Most helpful comment

These functions are not currently documented in sequelize. Think of them as lower level (raw) functions that don't access the models, so anything you want to insert/update/delete needs to be specified.

Regarding referencing tables in migrations, it's the same as on models:

references : {
    model : "table_name",
    key   : "key_on_the_table",
}

All 4 comments

Also, where is the documentation for working with seed files? For example I created a seed file and ran it using bulkInsert but that apparently doesn't update createdAt and updateAt.... Funny, if I search the documentation for bulkInsert:

https://readthedocs.org//search/?q=seed&check_keywords=yes&area=default&project=sequelize&version=latest&type=file

I get nothing....

So is the search engine for the documentation broken or is that really not a documented feature?

I'm new to Sequelize so I don't know a lot about it so far, but having such a difficult time finding basic documentation for this type of stuff.... I dunno. Not a good sign imo. Hopefully I'm just overlooking something super obvious...

These functions are not currently documented in sequelize. Think of them as lower level (raw) functions that don't access the models, so anything you want to insert/update/delete needs to be specified.

Regarding referencing tables in migrations, it's the same as on models:

references : {
    model : "table_name",
    key   : "key_on_the_table",
}

You can use sequelize-auto :Automatically generate models for SequelizeJS via the command line.
address is https://github.com/sequelize/sequelize-auto.git

@IkarosCoCo I think that what he needs is the opposite of sequelize-auto, which is generate the migrations for the models that he already have, not otherwise.

Was this page helpful?
0 / 5 - 0 ratings