Advertisement
garethdaine

Create Courses Migration

Apr 19th, 2013
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.69 KB | None | 0 0
  1. use Illuminate\Database\Migrations\Migration;
  2.  
  3. class CreateCourses extends Migration {
  4.  
  5.     /**
  6.      * Run the migrations.
  7.      *
  8.      * @return void
  9.      */
  10.     public function up()
  11.     {
  12.         Schema::create('courses', function($table) {
  13.  
  14.             // auto incremental id
  15.             $table->increments('id');
  16.  
  17.             // int
  18.             $table->integer('price');
  19.             $table->integer('duration');
  20.             $table->integer('course_type_id');
  21.  
  22.             // varchar
  23.             $table->string('title', 32);
  24.  
  25.             // text
  26.             $table->text('description');
  27.  
  28.             // created_at | updated_at DATETIME
  29.             $table->timestamps();
  30.  
  31.         });
  32.     }
  33.  
  34.     /**
  35.      * Reverse the migrations.
  36.      *
  37.      * @return void
  38.      */
  39.     public function down()
  40.     {
  41.         Schema::drop('courses');
  42.     }
  43.  
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement