/**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     $this->schema->create('roles', function (Blueprint $table) {
         $table->increments('id');
         $table->string('name')->unique();
     });
 }
 /**
  * Run the migrations.
  */
 public function up()
 {
     $this->schema->create('password_resets', function (Blueprint $table) {
         $table->string('email')->index();
         $table->string('token')->index();
         $table->timestamp('created_at');
     });
 }
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     $this->schema->create('ages', function (Blueprint $table) {
         $table->increments('id');
         $table->string('from');
         $table->string('to');
     });
 }
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     $this->schema->create('countries', function (Blueprint $table) {
         $table->increments('id');
         $table->string('code');
         $table->string('name');
     });
 }
 /**
  * Do the migration
  */
 public function up()
 {
     //Create
     $this->schema->create('account_status', function ($table) {
         $table->increments('id');
         $table->string('value', 200);
         $table->dateTime('created_at')->default(DB::raw('CURRENT_TIMESTAMP'));
     });
 }
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     $this->schema->create('notifications', function (Blueprint $table) {
         $table->increments('id');
         $table->string('title');
         $table->string('body');
         $table->dateTime('release_date');
         $table->timestamps();
     });
 }
 /**
  * Install the extensions table.
  */
 public function handle()
 {
     $this->schema->dropIfExists('addons_extensions');
     $this->schema->create('addons_extensions', function (Blueprint $table) {
         $table->increments('id');
         $table->string('slug');
         $table->boolean('installed')->default(0);
         $table->boolean('enabled')->default(0);
     });
 }
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     $this->schema->create('user_roles', function (Blueprint $table) {
         $table->increments('id');
         $table->integer('user_id')->unsigned()->index();
         $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
         $table->integer('role_id')->unsigned()->index();
         $table->foreign('role_id')->references('id')->on('roles')->onDelete('cascade');
     });
 }
 /**
  * Do the migration
  */
 public function up()
 {
     $this->schema->create('posts', function ($table) {
         $table->increments('id');
         $table->integer('user_id')->unsigned();
         $table->text('content');
         $table->timestamps();
         $table->softDeletes();
         $table->foreign('user_id')->references('id')->on('users');
     });
 }
 /**
  * Do the migration
  */
 public function up()
 {
     //Create table
     $this->schema->create('ci_sessions', function ($table) {
         $table->string('session_id', 40);
         $table->string('ip_address', 45);
         $table->string('user_agent', 120);
         $table->integer('last_activity')->unsigned();
         $table->text('user_data');
     });
 }
Exemplo n.º 11
0
 /**
  * Run the migrations.
  */
 public function up()
 {
     $this->schema->create('users', function (Blueprint $table) {
         $table->increments('id');
         $table->string('name');
         $table->string('email')->unique();
         $table->string('password');
         $table->rememberToken();
         $table->timestamps();
     });
 }
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     $this->schema->create('products', function (Blueprint $table) {
         $table->increments('id');
         $table->string('name');
         $table->string('code')->unique();
         $table->string('image');
         $table->string('poster');
         $table->timestamps();
     });
 }
 /**
  * Do the migration
  */
 public function up()
 {
     //Creates contents table
     $this->schema->create('contents', function ($table) {
         $table->increments('id');
         $table->string('title');
         $table->text('text');
         $table->timestamps();
         $table->softDeletes();
     });
 }
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     $this->schema->create('profiles', function (Blueprint $table) {
         $table->increments('id');
         $table->string('image');
         $table->longText('description');
         $table->integer('product_id')->unsigned()->index();
         $table->foreign('product_id')->references('id')->on('products')->onDelete('cascade');
         $table->timestamps();
     });
 }
 /**
  * Do the migration
  */
 public function up()
 {
     $this->schema->create('likes', function ($table) {
         $table->increments('id');
         $table->integer('user_id')->unsigned();
         $table->string('resourceable_type');
         $table->string('resourceable_id');
         $table->timestamps();
         $table->softDeletes();
         $table->foreign('user_id')->references('id')->on('users');
     });
 }
Exemplo n.º 16
0
 /**
  * Run migrations for tables only used for testing purposes.
  *
  * @return void
  */
 protected function runTestMigrations()
 {
     include_once __DIR__ . '/../resources/migrations/create_adjustments_table.php.stub';
     (new \CreateAdjustmentsTable())->up();
     if (!$this->schema->hasTable('fruits')) {
         $this->schema->create('fruits', function (Blueprint $table) {
             $table->increments('id');
             $table->string('name');
             $table->integer('price');
         });
     }
 }
 /**
  * Do the migration
  */
 public function up()
 {
     //Create the table
     $this->schema->create('account_verification_tokens', function ($table) {
         $table->increments('id');
         $table->integer('user_id')->unsigned();
         $table->string('token', 100);
         $table->enum('status', ['active', 'expired']);
         $table->dateTime('created_at')->default(DB::raw('CURRENT_TIMESTAMP'));
         $table->foreign('user_id')->references('id')->on('users');
     });
 }
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     $this->schema->create('help', function (Blueprint $table) {
         $table->increments('id');
         $table->string('route');
         $table->string('route_parameters')->nullable();
         $table->string('description')->nullable();
         $table->longText('parameters')->nullable();
         $table->longText('response')->nullable();
         $table->longText('response_error')->nullable();
     });
 }
 /**
  * Do the migration
  */
 public function up()
 {
     //Create user details table
     $this->schema->create('user_details', function ($table) {
         $table->increments('id');
         $table->integer('user_id')->unsigned();
         $table->text('hobbies');
         $table->text('interests');
         $table->text('about');
         $table->foreign('user_id')->references('id')->on('users');
     });
 }
 /**
  * Do the migration
  */
 public function up()
 {
     //Create table
     $this->schema->create('contact_messages', function ($table) {
         $table->increments('id');
         $table->string('first_name');
         $table->string('last_name');
         $table->string('email');
         $table->text('message');
         $table->timestamps();
         $table->softDeletes();
     });
 }
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     $this->schema->create('codes', function (Blueprint $table) {
         $table->increments('id');
         $table->integer('product_id')->unsigned()->index();
         $table->foreign('product_id')->references('id')->on('products')->onDelete('cascade');
         $table->integer('user_id')->unsigned()->index()->nullable();
         $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
         $table->string('code')->unique();
         $table->boolean('status')->default(false);
         $table->timestamps();
     });
 }
Exemplo n.º 22
0
 /**
  * Create translations table.
  *
  * @param $table
  * @param $foreignKey
  */
 public function createTranslationsTable($table)
 {
     $this->schema->dropIfExists($table);
     $this->schema->create($table, function (Blueprint $table) {
         $table->increments('id');
         $table->integer('entry_id');
         $table->datetime('created_at');
         $table->integer('created_by')->nullable();
         $table->datetime('updated_at')->nullable();
         $table->integer('updated_by')->nullable();
         $table->string('locale')->index();
     });
 }
 /**
  * Do the migration
  */
 public function up()
 {
     //Create eduction table
     $this->schema->create('user_educations', function ($table) {
         $table->increments('id');
         $table->integer('user_id')->unsigned();
         $table->string('institution_name');
         $table->string('major');
         $table->string('year_joined');
         $table->string('year_left')->nullable();
         $table->boolean('is_current');
         $table->foreign('user_id')->references('id')->on('users');
     });
 }
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     $this->schema->create('jobs', function (Blueprint $table) {
         $table->bigIncrements('id');
         $table->string('queue');
         $table->longText('payload');
         $table->tinyInteger('attempts')->unsigned();
         $table->tinyInteger('reserved')->unsigned();
         $table->unsignedInteger('reserved_at')->nullable();
         $table->unsignedInteger('available_at');
         $table->unsignedInteger('created_at');
         $table->index(['queue', 'reserved', 'reserved_at']);
     });
 }
 /**
  * Do the migration
  */
 public function up()
 {
     //Create user work table
     $this->schema->create('user_works', function ($table) {
         $table->increments('id');
         $table->integer('user_id')->unsigned();
         $table->string('job_title');
         $table->string('company_name');
         $table->dateTime('date_joined');
         $table->dateTime('date_left')->nullable();
         $table->boolean('is_current');
         $table->foreign('user_id')->references('id')->on('users');
     });
 }
 /**
  * Do the migration
  */
 public function up()
 {
     //Create the table
     $this->schema->create('users_basic_info', function ($table) {
         $table->increments('id');
         $table->integer('user_id')->unsigned();
         $table->string('address');
         $table->string('city');
         $table->string('country');
         $table->string('phone_number');
         $table->text('emails');
         $table->foreign('user_id')->references('id')->on('users');
     });
 }
 /**
  * Do the migration
  */
 public function up()
 {
     //Create the table
     $this->schema->create('uom_valid_ids', function ($table) {
         $table->string('id', 50);
         $table->string('first_name', 100);
         $table->string('last_name', 100);
         $table->enum('type', ['student', 'lecturer']);
         $table->timestamp('datetime')->default(DB::raw('CURRENT_TIMESTAMP'));
         $table->boolean('valide');
         $table->boolean('has_account');
         $table->primary('id');
     });
 }
 /**
  * Do the migration
  */
 public function up()
 {
     //Create friends table
     $this->schema->create('friends', function ($table) {
         $table->increments('id');
         $table->integer('user_id_1')->unsigned();
         $table->integer('user_id_2')->unsigned();
         $table->timestamps();
     });
     //Add foreign keys
     $this->schema->table('friends', function ($table) {
         $table->foreign('user_id_1')->references('id')->on('users');
         $table->foreign('user_id_2')->references('id')->on('users');
     });
 }
 /**
  * Do the migration
  */
 public function up()
 {
     //Create passwords table
     $this->schema->create('passwords', function ($table) {
         $table->increments('id');
         $table->integer('user_id')->unsigned();
         $table->string('code', 255);
         $table->timestamps();
         $table->softDeletes();
     });
     //Add foreign key to table
     $this->schema->table('passwords', function ($table) {
         $table->foreign('user_id')->references('id')->on('users');
     });
 }
 /**
  * Handle the event.
  *
  * @param AssignmentWasCreated $event
  */
 public function handle(AssignmentWasCreated $event)
 {
     $assignment = $event->getAssignment();
     $fieldType = $assignment->getFieldType();
     if (!$fieldType instanceof FilesFieldType) {
         return;
     }
     $table = $assignment->getStreamPrefix() . $assignment->getStreamSlug() . '_' . $fieldType->getField();
     $this->schema->dropIfExists($table);
     $this->schema->create($table, function (Blueprint $table) {
         $table->integer('entry_id');
         $table->integer('file_id');
         $table->integer('sort_order')->nullable();
         $table->primary(['entry_id', 'file_id']);
     });
 }