Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Schema::create('campaign', function (Blueprint $table) {
- $table->engine='InnoDB';
- $table->increments('id');
- $table->integer('users_id')->unsigned();
- $table->foreign('users_id')->references('id')->on('users')->onDelete('cascade')->onUpdate('cascade');
- $table->string('campaign_name');
- $table->float('campaign_goal',8,2);
- $table->string('discription',400);
- $table->string('image');
- $table->string('category');
- $table->date('start_date');
- $table->date('end_date');
- $table->float('total_fund',8,2);
- });
- Schema::create('campaign_product', function (Blueprint $table) {
- $table->engine='InnoDB';
- $table->increments('id');
- $table->integer('campaign_id')->unsigned();
- $table->foreign('campaign_id')->references('id')->on('campaign')->onDelete('cascade')->onUpdate('cascade');
- $table->integer('product_id')->unsigned();
- $table->foreign('product_id')->references('id')->on('product')->onDelete('cascade')->onUpdate('cascade');
- });
Add Comment
Please, Sign In to add comment