Calls the given function passing this
as the only argument.
See $call
See addColumn
Unlike addForeignKeyConstraint this method returns
the constraint builder and doesn't take a callback as the last argument. This
is because you can only add one column per ALTER TABLE
query.
This can be used to add index to table.
db.schema.alterTable('person')
.addIndex('person_email_index')
.column('email')
.unique()
.execute()
The generated SQL (MySQL):
alter table `person` add unique index `person_email_index` (`email`)
This can be used to drop index from table.
db.schema.alterTable('person')
.dropIndex('person_email_index')
.execute()
The generated SQL (MySQL):
alter table `person` drop index `test_first_name_index`
Creates an alter table modify column
query. The modify column
statement
is only implemeted by MySQL and oracle AFAIK. On other databases you
should use the alterColumn
method.
Generated using TypeDoc
This builder can be used to create a
alter table
query.