Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter4 - How i can add extra 3 fields to a created table using Migration ?
#3

(05-10-2024, 05:08 AM)sarath_unrelax Wrote: So I should create a new migration fille seperate for each field

No.

(05-10-2024, 05:08 AM)sarath_unrelax Wrote: or i can just create a migration file using below command ?

Code:
php spark make:migration AddExtraFieldsToEmployeesTable

Yes, but note that you must use a unique classname in all migration classes (now and in the future).

(05-10-2024, 05:08 AM)sarath_unrelax Wrote: After i can use addField() command in up() and removeFiled() in down() ?

No, you must use addColumn() and dropColumn().
https://codeigniter4.github.io/CodeIgnit...to-a-table
https://codeigniter4.github.io/CodeIgnit...dropcolumn
Reply


Messages In This Thread
RE: CodeIgniter4 - How i can add extra 3 fields to a created table using Migration ? - by kenjis - 05-10-2024, 04:45 PM



Theme © iAndrew 2016 - Forum software by © MyBB