Created
June 6, 2014 06:08
-
-
Save joeydaly/d1959884bc28d7138ed2 to your computer and use it in GitHub Desktop.
DBMigrate - references not working bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfcomponent extends="joey.cfwheels.plugins.dbmigrate.Migration" hint="create player table"> | |
<cffunction name="up"> | |
<cfscript> | |
t = createTable(name='players'); | |
t.string(columnNames='first_name', default='', null=true, limit='255'); | |
t.string(columnNames='last_name', default='', null=true, limit='255'); | |
t.timestamps(); | |
t.create(); | |
</cfscript> | |
</cffunction> | |
<cffunction name="down"> | |
<cfscript> | |
dropTable('players'); | |
</cfscript> | |
</cffunction> | |
</cfcomponent> | |
<cfcomponent extends="joey.cfwheels.plugins.dbmigrate.Migration" hint="create club table"> | |
<cffunction name="up"> | |
<cfscript> | |
t = createTable(name='clubs'); | |
t.string(columnNames='name', default='', null=true, limit='255'); | |
t.timestamps(); | |
t.create(); | |
</cfscript> | |
</cffunction> | |
<cffunction name="down"> | |
<cfscript> | |
dropTable('clubs'); | |
</cfscript> | |
</cffunction> | |
</cfcomponent> | |
<cfcomponent extends="joey.cfwheels.plugins.dbmigrate.Migration" hint="add club reference on player table"> | |
<cffunction name="up"> | |
<cfscript> | |
t = changeTable('players'); | |
t.references('club'); | |
t.change(); | |
</cfscript> | |
</cffunction> | |
<cffunction name="down"> | |
<cfscript> | |
dropReference('players','club'); | |
</cfscript> | |
</cffunction> | |
</cfcomponent> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment