Skip to content

Instantly share code, notes, and snippets.

@ydatech
Created September 4, 2016 09:55
Show Gist options
  • Select an option

  • Save ydatech/88f3a05a4aa2edb2269461744f54bdc2 to your computer and use it in GitHub Desktop.

Select an option

Save ydatech/88f3a05a4aa2edb2269461744f54bdc2 to your computer and use it in GitHub Desktop.
Create table user using yii migration
# 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