Welcome Guest, Not a member yet? Register   Sign In
dbforge create key/index on existing table
#1

[eluser]GlennJ[/eluser]
I can create a new table with a key using DB Forge, that's pretty easy.

However, there doesn't seem to be an option to add a key to an existing table?

Am I being dense and missing something here? This is for an ExpressionEngine module, so I want to do it the correct way.
#2

[eluser]InsiteFX[/eluser]
Something like this:
Code:
$this->db->query("ALTER TABLE table_name ADD COLUMN column_name varchar(255)");
#3

[eluser]GlennJ[/eluser]
That doesn't use dbforge though, so it'll only work for MySQL databases.
#4

[eluser]John Morton[/eluser]
Glenn,

Did you find out how to add the key? I'm looking for the same answer.

-John
#5

[eluser]GlennJ[/eluser]
[quote author="John Morton" date="1335279479"]Glenn,

Did you find out how to add the key? I'm looking for the same answer.

-John[/quote]

You can't using DB Forge buy the looks of things, maybe this is because of compatibility across different database types.

For me, as ExpressionEngine only supports MySQL, I did it using a SQL query.
#6

[eluser]John Morton[/eluser]
Same here. Trying to update a DB for an EE add on, so I will go the SQL route as well. DBForge seemed like a good choice for future compatibly, you know, in case EE supported other DBs in the future, but I can deal with this again if that ever becomes an issue. Thanks for the quick reply.




Theme © iAndrew 2016 - Forum software by © MyBB