Welcome Guest, Not a member yet? Register   Sign In
Add Primary column with dbforge library
#4

Did you try calling add_key() first, then add_column()? The main reason I ask is that when creating a table, add_key() and add_field() just modify the state of dbforge, while create_table does the actual SQL generation and execution. add_column() also generates and executes the SQL, so add_key() would have to be called before it to have any chance to work properly. Unfortunately, without testing, I don't know if add_column() will actually add a primary key, though.

If that doesn't work, you may have to create a new table and copy the data over.
Reply


Messages In This Thread
RE: Add Primary column with dbforge library - by mwhitney - 02-17-2015, 09:18 AM



Theme © iAndrew 2016 - Forum software by © MyBB