Вход Регистрация
Файл: src/database/migrations/2016_04_14_191719_create_items_table.php
Строк: 34
<?php

use IlluminateDatabaseMigrationsMigration;
use 
IlluminateDatabaseSchemaBlueprint;

class 
CreateitemsTable extends Migration {

    
/**
     * Run the migrations.
     *
     * @return void
     */
    
public function up()
    {
        
Schema::create('Items', function(Blueprint $table)
        {
            
$table->increments('ItemID')->unsigned();
            
$table->integer('ProductID',false,true);
            
$table->integer('InvoiceID',false,true);
            
$table->decimal('Price',10,2);
            
$table->integer('Amount',false,true);
            
$table->decimal('Discount',10,2)->default(0);
            
$table->decimal('Tax',10,2)->default(0);
            
$table->decimal('Total',10,2);
            
$table->timestamp("CreatedAt");
            
$table->timestamp("UpdatedAt");
            
$table->timestamp("DeletedAt")->nullable();
        });
    }


    
/**
     * Reverse the migrations.
     *
     * @return void
     */
    
public function down()
    {
    
DB::statement('SET FOREIGN_KEY_CHECKS=0;');
        
Schema::drop('Items');
    
DB::statement('SET FOREIGN_KEY_CHECKS=1;');
    }

}
Онлайн: 1
Реклама