You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I am working within Regent, I should be able to write migration scripts to alter the schema of my database. Within this model, I should be able to perform all of the schema manipulations and table seeding necessary to create versioned databases. When migrations are performed, those migrations should be tracked inside the database so that the system is aware of what transformations and seeds have already been completed.
Create a Column Schema class
after(<name>) inserts the current column after the column <name>
autoIncrement() sets the current column to be an auto-incrementing field
charset(<char>) sets the current column to the <char> charset
collation(<coll>) sets the current column to use <coll> collation
comment(<text>) sets the current column to have the comment <comment>
default(<value>) sets the current column to use the <value> default value
first() moves the column to the first column in the table
nullable(<value = true>) allows or disallows the column to hold null values
storedAs(<expression>) stores composite columns
unsigned() sets numerical columns to be unsigned
useCurrent() sets date columns to be current dates
virtualAs(<expression>) sets the virtual column in MySQL
Description
When I am working within Regent, I should be able to write migration scripts to alter the schema of my database. Within this model, I should be able to perform all of the schema manipulations and table seeding necessary to create versioned databases. When migrations are performed, those migrations should be tracked inside the database so that the system is aware of what transformations and seeds have already been completed.
after(<name>)
inserts the current column after the column<name>
autoIncrement()
sets the current column to be an auto-incrementing fieldcharset(<char>)
sets the current column to the<char>
charsetcollation(<coll>)
sets the current column to use<coll>
collationcomment(<text>)
sets the current column to have the comment<comment>
default(<value>)
sets the current column to use the<value>
default valuefirst()
moves the column to the first column in the tablenullable(<value = true>)
allows or disallows the column to hold null valuesstoredAs(<expression>)
stores composite columnsunsigned()
sets numerical columns to be unsigneduseCurrent()
sets date columns to be current datesvirtualAs(<expression>)
sets the virtual column in MySQLreferences(<column>, <table>, <onDelete>)
sets foreign-key constraintsset(<setting>, <value>)
sets a configuration settingget(<setting>)
gets a configuration settinghas(<setting>)
checks whether a configuration setting existstemporary()
sets the table as being temporarybigIncrement(<name>)
creates a big-integer incrementing fieldbigInteger(<name>)
creates a big-integer fieldbinary(<name>)
creates a BLOB fieldboolean(<name>)
creates a boolean fieldchar(<name>, <size>)
creates a character fielddate(<name>)
creates a date fielddateTime(<name>)
creates a date-time fielddateTimeTz(<name>)
creates a date-time field with timezonedecimal(<name>, <precision>, <scale>)
creates a decimal fielddouble(<name>, <precision>, <scale>)
creates a double-precision fieldenum(<name>, [ ... <values>])
creates an enumerated fieldfloat(<name>, <precision>, <scale>)
creates a float fieldgeometry(<name>)
creates a geometry fieldgeometryCollection(<name>)
creates a geometry collection fieldincrements(<name>)
creates an auto-increment columninteger(<name>)
creates an integer fieldipAddress(<name>)
creates an IP Address fieldjson(<name>)
creates a JSON fieldjsonb(<name>)
creates a JSONB fieldlineString(<name>)
creates a linestring fieldlongText(<name>)
creates a longtext fieldmacAddress(<name>)
creates a mac address fieldmediumIncrement(<name>)
creates a medium-size integer auto-incrementing fieldmediumInteger(<name>)
creates a medium-sized integer fieldmediumText(<name>)
creates a mediumtext fieldmorphs(<name>)
creates UINT <name_id> and VARCHAR <name_type> fieldsmultilineString(<name>)
creates multilinestring fieldmultiPoint(<name>)
creates multipoint fieldmultiPolygon(<name>)
creates multipolygon fieldnullableMorphs(<name>)
creates nullable version ofmorphs()
point(<name>)
creates point fieldpolygon(<name>)
creates a polygon fieldsmallIncrements(<name>)
creates a small-integer autoincrementing fieldsmallInteger(<name>)
creates a small-integer fieldsoftDeletes()
creates a "deleted_at" nullable timestamp fieldsoftDeletesTz()
creates a "deleted_at" nullable timestamp field with timezonestring(<name>, [<size>])
creates a varchar field of lengthtext(<name>)
creates a text fieldtime(<name>)
creates a time fieldtimeTz(<name>)
creates a time field with timezonetimestamp(<name>)
creates a timestamp fieldtimestampTz(<name>)
creates a timestamp field with timezonetimestamps()
creates the "created_at" and "updated_at" timestamp fieldstimestampsTz()
creates the "created_at" and "updated_at" timestamp fields with timezonestinyIncrement(<name>)
creates a tiny-int auto-incrementertinyInteger(<name>)
creates a tiny-integerunsignedBigInteger(<name>)
creates an unsigned bigint fieldunsginedDecimal(<name>)
creates an unsigned decimal fieldunsignedInteger(<name>)
creates an unsigned integer fieldunsignedMediumInteger(<name>)
creates an unsigned medium integer fieldunsignedSmallInteger(<name>)
creates an unsigned small integer fieldunsignedTinyInteger(<name>)
creates an unsigned tiny integer fielduuid(<name>)
creates a UUID fieldyear(<name>)
creates a year fieldcreate(<name>, (<tableSchema>) => { /* do things */ })
initialize a table blueprinthasTable(<name>)
check if a table existshasColumn(<table>, <column>)
check if a table has a columnrename(<old>, <new>)
rename a tabledrop(<table>)
drop a tabledropIfExists(<table>)
drop a table if it existstable(<name>)
get a table schemasetForeignKeyConstraints(<boolean>)
enable/disable foreign key constraintsstatic connection(<dbName>)
use a specific database schemaThe text was updated successfully, but these errors were encountered: