Created
September 4, 2016 09:55
-
-
Save ydatech/88f3a05a4aa2edb2269461744f54bdc2 to your computer and use it in GitHub Desktop.
Create table user using yii migration
This file contains hidden or 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
| # buat migration untuk table baru bernama user: php yii migrate/create create_user_table | |
| # untuk membuat kolom beserta tipe data kita bisa menggunakan parameter --fields | |
| # kolom primary key yaitu id akan secara otomatis digenerate tanpa harus mendefinisikannya di parameter --fields | |
| php yii migrate/create create_user_table --fields="username:string(20):notNull:unique,password:string(255):notNull,email:string(255):notNull,status:smallInteger(1):defaultValue(0),dibuat_pada:integer(10),diperbarui_pada:integer(10)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment