Welcome Guest, Not a member yet? Register   Sign In
DB Forge: possibility to change / set a primary key on a field of an existing table?
#1

(This post was last modified: 05-06-2021, 09:22 AM by Zeff.)

Hi all,

I was reading the user guide on the CI4 Database Forge class.
I want to set a primary key on an field of an (existing) table. 

The addPrimaryKey() should be use on fields that must be created, but is there a possibility to do so on an existing one (by mesans of modifyColumn() for example...)? 

Thanks in advance!
Reply
#2

I'm pretty sure that you would need to use alter table field to make it a primary key.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB