class CreateTable

Included Modules

Defined in:

db/migrate/1234_create_table.cr

Instance Method Summary

Instance Method Detail

def change(direction) #

[View source]
def uid : Int64 #

Return the migration number (Unique ID or UID) for migration sorting.

Default behavior (By order of priority):

  • The uid will be generated by the class name, if the class name contains number at the end.
  • If there's no numbers in the migration class, then it will try to use the id in the filename
  • If not found, an exception is raised. This method can be overwritten by the concrete migration in case you need it.

Example:

class MyMigration1234567 # << Order = 1234567 file db/1234567_my_migration.cr # << Order = 1234567


[View source]