samedi 29 octobre 2016

Laravel create table, wchich hav other fields

I hav question, i create database, wchich have 6 tables and make recommendation

php artisan make:migration create_users_table2

Return me score Migration table created successfully. Created Migration: 2016_10_29_092820_create_users_table2

then make recommendation php artisan migrate

Return me score Migration table created successfully. Migrated: 2014_10_12_000000_create_users_table Migrated: 2014_10_12_100000_create_password_resets_table Migrated: 2016_10_29_092820_create_users_table2

and have created databases, but other from other tables, That is my file about name 2014_10_12_000000_create_users_table

<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
  use Illuminate\Database\Migrations\Migration;

  class CreateUsersTable extends Migration
{
/**
 * Run the migrations.
 *
 * @return void
 */
public function up()
{
    Schema::create('users', function (Blueprint $table) {
        $table->increments('id');
        $table->string('login',60);
        $table->string('email');
        $table->integer('date_registration');
        $table->string('password',200);
        $table->string('permissions',1);
        $table->rememberToken();
        $table->timestamps();
    });

   Schema::create('statistics', function (Blueprint $table) {
        $table->increments('id');
        $table->integer('date');
        $table->string('variable_http_user_agent',200)
        $table->string('page',200);
        $table->string('ip',20);
        $table->string('user',60);
    });

   Schema::create('products', function (Blueprint $table) {
        $table->increments('id');
        $table->string('name',100);
        $table->integer('id_category');
        $table->integer('id_category2');
        $table->float('price');
        $table->text('description');
        $table->bool('auction');
        $table->bool('sold');
        $table->integer('id_usera');
        $table->integer('quantity');
        $table->string('path_to_image',100);

    });        
   Schema::create('basket', function (Blueprint $table) {
        $table->increments('id');
        $table->string('quantity_products',100);
        $table->integer('id_usera');

    });        
   Schema::create('category', function (Blueprint $table) {
        $table->increments('id');
        $table->string('name',100);

    });        
   Schema::create('category2', function (Blueprint $table) {
        $table->increments('id');
        $table->string('name',100);

    });        

}

/**
 * Reverse the migrations.
 *
 * @return void
 */
public function down()
{
    Schema::drop('users');
    Schema::drop('statistics');
    Schema::drop('products');
    Schema::drop('basket');
    Schema::drop('category');
    Schema::drop('category2');
}

}



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2el8Ft0
via IFTTT

Aucun commentaire:

Enregistrer un commentaire