| 1 | <?php |
||
| 6 | class CreateTicketsTable extends Migration |
||
| 7 | { |
||
| 8 | /** |
||
| 9 | * Run the migrations. |
||
| 10 | * |
||
| 11 | * @return void |
||
| 12 | */ |
||
| 13 | public function up() |
||
| 14 | { |
||
| 15 | Schema::create('cas_tickets', function (Blueprint $table) { |
||
| 16 | $table->increments('id'); |
||
| 17 | $table->string('ticket', 32)->unique(); |
||
| 18 | $table->string('service_url', 1024); |
||
| 19 | $table->integer('service_id')->unsigned(); |
||
| 20 | $table->integer('user_id')->unsigned(); |
||
| 21 | $table->timestamp('created_at')->nullable(); |
||
| 22 | $table->timestamp('expire_at')->nullable(); |
||
| 23 | $table->foreign('service_id')->references('id')->on('cas_services'); |
||
| 24 | $table->foreign('user_id')->references(config('cas.user_table.id'))->on(config('cas.user_table.name')); |
||
| 25 | }); |
||
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Reverse the migrations. |
||
| 30 | * |
||
| 31 | * @return void |
||
| 32 | */ |
||
| 33 | public function down() |
||
| 34 | { |
||
| 35 | Schema::drop('cas_tickets'); |
||
| 36 | } |
||
| 37 | } |
||
| 38 |