Migrator
Migrator
addColumn()— adds a column to existing tableaddForeignKey()— Add a foreign key constraint to the database, using the reference name that was used to create itaddIndex()— Add database index on a table columnaddRecord()— Adds a record to a tableaddReference()— Add a foreign key constraint to the database, using the reference name that was used to create itannounce()— Used internally by Migrator to provide feedback to the GUI and CLI about completed DB operationsbigInteger()— 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 databasechangeColumn()— changes a column definitionchangeTable()— Creates a table definition object to store modifications to table propertieschar()— adds char columns to table definitioncolumn()— Adds a column to table definition.create()— creates the table in the databasecreateMigration()— Creates a migration file. Whilst you can use this in your application, the recommended usage is via either the CLI or thcreateTable()— Creates a table definition object to store table propertiescreateView()— Creates a view definition object to store view propertiesdate()— Adds date columns to table definition.datetime()— adds datetime columns to table definitiondecimal()— adds decimal columns to table definitiondown()— Migrates down: will be executed when migrating your schema backwarddropForeignKey()— Drops a foreign key constraint from the databasedropReference()— Drop a foreign key constraint from the database, using the reference name that was used to create itdropTable()— Drops a table from the databasedropView()— drops a view from the databaseexecute()— Executes a raw sql queryfloat()— adds float columns to table definitiongetAvailableMigrations()— Searches db/migrate folder for migrations. Whilst you can use this in your application, the recommended usage is via eitgetCurrentMigrationVersion()— Returns current database version. Whilst you can use this in your application, the recommended usage is via either the Cinteger()— adds integer columns to table definitionmigrateIndividual()— 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 eithmigrateToLatest()— Shortcut function to migrate to the latest versionprimaryKey()— 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 eitherreferences()— adds integer reference columns to table definition and creates foreign key constraintsremoveColumn()— Removes a column from a database tableremoveIndex()— Remove a database indexremoveRecord()— Removes existing records from a tablerenameColumn()— Renames a table columnrenameSystemTables()— F15 Phase 2: rename legacyc_o_r_e_system tables towheels_.renameTable()— Renames a tablestring()— adds string columns to table definitiontext()— Adds text columns to table definition.time()— adds time columns to table definitiontimestamp()— adds timestamp columns to table definitiontimestamps()— adds Wheels convention automatic timestamp and soft delete columns to table definitionuniqueidentifier()— adds UUID columns to table definitionup()— Migrates up: will be executed when migrating your schema forwardupdateRecord()— Updates an existing record in a table