table_create.php 1.06 KB
<?php namespace App\Console\Commands;

use Illuminate\Console\Command;
//use Mail;
use DB;
use Config;
use Input;

use Schema;
use PDO;




use Illuminate\Database\Schema\Blueprint;

class table_create extends Command {

	/**
	 * The console command name.
	 *
	 * @var string
	 */
	protected $signature = 'table_create';

	/**
	 * The console command description.
	 *
	 * @var string
	 */
	protected $description = 'table_create';

	/**
	 * Execute the console command.
	 *
	 * @return mixed
	 */
	public function handle()
	{
    $date=date('F_Y');
  echo $date;
		echo 'Start';
           
           for($i=1;$i<=31;$i++)
           {
           	 $table_name = "full_remark_".$i.$date;
             echo $table_name;
			 DB::statement("CREATE TABLE $table_name (id int(11) NOT NULL,call_id int(11) NOT NULL,fullremark varchar(5000) NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4");

			 DB::statement("ALTER TABLE $table_name ADD PRIMARY KEY (id)");

			 DB::statement("ALTER TABLE $table_name MODIFY id int(11) NOT NULL AUTO_INCREMENT");

           }

			
		echo 'End';
	}
}