Skip to content

Migrator

Migrator

  • addColumn() — adds a column to existing table
  • addForeignKey() — Add a foreign key constraint to the database, using the reference name that was used to create it
  • addIndex() — Add database index on a table column
  • addRecord() — Adds a record to a table
  • addReference() — Add a foreign key constraint to the database, using the reference name that was used to create it
  • announce() — Used internally by Migrator to provide feedback to the GUI and CLI about completed DB operations
  • bigInteger() — Adds integer columns to table definition.
  • binary() — Adds binary columns to table definition.
  • boolean() — Adds boolean columns to table definition.
  • change() — alters existing table in the database
  • changeColumn() — changes a column definition
  • changeTable() — Creates a table definition object to store modifications to table properties
  • char() — adds char columns to table definition
  • column() — Adds a column to table definition.
  • create() — creates the table in the database
  • createMigration() — Creates a migration file. Whilst you can use this in your application, the recommended usage is via either the CLI or th
  • createTable() — Creates a table definition object to store table properties
  • createView() — Creates a view definition object to store view properties
  • date() — Adds date columns to table definition.
  • datetime() — adds datetime columns to table definition
  • decimal() — adds decimal columns to table definition
  • down() — Migrates down: will be executed when migrating your schema backward
  • dropForeignKey() — Drops a foreign key constraint from the database
  • dropReference() — Drop a foreign key constraint from the database, using the reference name that was used to create it
  • dropTable() — Drops a table from the database
  • dropView() — drops a view from the database
  • execute() — Executes a raw sql query
  • float() — adds float columns to table definition
  • getAvailableMigrations() — Searches db/migrate folder for migrations. Whilst you can use this in your application, the recommended usage is via eit
  • getCurrentMigrationVersion() — Returns current database version. Whilst you can use this in your application, the recommended usage is via either the C
  • integer() — adds integer columns to table definition
  • migrateIndividual() — Runs a single specific migration’s up() regardless of sequence order.
  • migrateTo() — Migrates database to a specified version. Whilst you can use this in your application, the recommended usage is via eith
  • migrateToLatest() — Shortcut function to migrate to the latest version
  • primaryKey() — Adds a primary key definition to the table. this method also allows for multiple primary keys.
  • redoMigration() — Reruns the specified migration version. Whilst you can use this in your application, the recommended usage is via either
  • references() — adds integer reference columns to table definition and creates foreign key constraints
  • removeColumn() — Removes a column from a database table
  • removeIndex() — Remove a database index
  • removeRecord() — Removes existing records from a table
  • renameColumn() — Renames a table column
  • renameSystemTables() — F15 Phase 2: rename legacy c_o_r_e_ system tables to wheels_.
  • renameTable() — Renames a table
  • string() — adds string columns to table definition
  • text() — Adds text columns to table definition.
  • time() — adds time columns to table definition
  • timestamp() — adds timestamp columns to table definition
  • timestamps() — adds Wheels convention automatic timestamp and soft delete columns to table definition
  • uniqueidentifier() — adds UUID columns to table definition
  • up() — Migrates up: will be executed when migrating your schema forward
  • updateRecord() — Updates an existing record in a table