Yes, the methods can be chained. In your case you just perform the addIndex
after createTable
method
return queryInterface.createTable('Todos', {
// columns...
}).then(() => queryInterface.addIndex('Todos', ['author_id', 'title']))
.then(() => {
// perform further operations if needed
});
Related Contents:
- How do I handle too long index names in a Ruby on Rails ActiveRecord migration?
- Disable intellij indexing on specific folder
- Difference between local and global indexes in DynamoDB
- Rails: Adding an index after adding column
- How can I stop indexing intellij idea?
- What’s the difference between an inverted index and a plain old index?
- How does MongoDB index arrays?
- Structuring online documentation for a REST API
- What is the use of “multiValued” field type in Solr?
- Create or update mapping in elasticsearch
- Solr commit and optimize questions
- Adjust Single Value within Tensor — TensorFlow
- Is it possible to change column index in rails 3 migration?
- Proper terminology, should I say indexes or indices? [closed]
- Index in Parquet
- In PANDAS, how to get the index of a known value?
- pandas – how to access cell in pandas, equivalent of df[3,4] in R
- How does a geospatial index work? [closed]
- R-Tree and Quadtree Comparison
- How to convert index of a pandas dataframe into a column
- List of all index & index columns in SQL Server DB
- How can I index a MATLAB array returned by a function without first assigning it to a local variable?
- Does MySQL index foreign key columns automatically?
- Entity Framework rollback and remove bad migration
- What rules does Pandas use to generate a view vs a copy?
- Rails 3 migrations: Adding reference column?
- How to drop unique in MySQL?
- Create an index on a huge MySQL production table without table locking
- How to make Sequelize use singular table names
- Do I need to create indexes on foreign keys on Oracle?
- Remove index name in pandas
- Rails has_and_belongs_to_many migration
- Indexes of all occurrences of character in a string
- jQuery .each() index?
- With MySQL, how can I generate a column containing the record index in a table?
- What datatype should be used for storing phone numbers in SQL Server 2005?
- With MySQL, how long does an “ALTER TABLE … DISABLE KEYS;” statement last?
- Numpy: For every element in one array, find the index in another array
- How to migrate a PostgreSQL database into a SQLServer one?
- Model.reset_column_information does not reload columns in rails migration
- SQL Server: Index columns used in like?
- Is the Sql Server Unique Key also an Index?
- Migrations in Entity Framework in a collaborative environment
- Writing Migrations with Foreign Keys Using SequelizeJS
- Multiple foreign keys referencing the same table in RoR
- How can I manipulate MySQL fulltext search relevance to make one field more ‘valuable’ than another?
- Implement list-like index access in Python
- PostgreSQL UUID type performance
- How to disable index in innodb
- Decision when to create Index on table column in database?