Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

multiple primary key defined laravel

public function up()
{
    Schema::create('spins', function (Blueprint $table) {
        $table->engine = 'MyISAM';
        $table->integer('rid')->unsigned();
        $table->bigInteger('pid');
        $table->integer('result');
        $table->integer('bet');
        $table->timestamps();
        $table->primary(array('rid', 'pid'));

        DB::statement('ALTER TABLE spins MODIFY rid INTEGER NOT NULL AUTO_INCREMENT');
    });
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #multiple #primary #key #defined #laravel
ADD COMMENT
Topic
Name
4+1 =