32 lines
599 B
Markdown
32 lines
599 B
Markdown
```bash
|
|
php spark make:scaffold Product
|
|
```
|
|
Creates Controller, Model, Migration, Seeder
|
|
|
|
```php
|
|
//up:
|
|
$this->forge->addField((["id"=>
|
|
["type"=>"INT,
|
|
"constraint"=>5,
|
|
"auto increment" => true,
|
|
"unsigned" => true
|
|
],
|
|
"name" => ["type"=>"VARCHAR".
|
|
"constraint" => 120,
|
|
"null" => false
|
|
]
|
|
]
|
|
));
|
|
$this->forge->addPrimaryKey("id);
|
|
$this->forge->createTable("students");
|
|
|
|
//down:
|
|
$this->forge->dropTable("students");
|
|
```
|
|
|
|
|
|
```bash
|
|
php spark migrate:status
|
|
|
|
php spark migrate
|
|
```
|