本文整理汇总了PHP中Schema::dropIfExists方法的典型用法代码示例。如果您正苦于以下问题:PHP Schema::dropIfExists方法的具体用法?PHP Schema::dropIfExists怎么用?PHP Schema::dropIfExists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Schema
的用法示例。
在下文中一共展示了Schema::dropIfExists方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: down
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('user_providers', function (Blueprint $table) {
$table->dropForeign('user_providers_user_id_foreign');
});
Schema::dropIfExists('user_providers');
}
开发者ID:nasirkhan,项目名称:laravel-5-starter,代码行数:12,代码来源:2015_11_15_101941_create_user_provivers_table.php
示例2: down
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('tblPayment');
Schema::table('tblPayment', function ($table) {
$table->dropColumn('strJobOrderID');
});
}
示例3: down
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('products');
Schema::dropIfExists('products_globex');
Schema::dropIfExists('products_ads');
Schema::dropIfExists('products_motors');
}
示例4: down
public function down()
{
Schema::table('products', function ($table) {
$table->dropIndex('search');
});
Schema::dropIfExists('products');
}
示例5: up
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
//
Schema::dropIfExists('alert_users');
Schema::dropIfExists('alert_registrations');
Schema::dropIfExists('alerts');
}
示例6: up
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::dropIfExists('sdc_users');
Schema::create('sdc_users', function (Blueprint $table) {
$table->engine = 'MyISAM';
$table->increments('id');
$table->string('email')->unique();
$table->string('password', 60);
$table->string('display_name', 100)->nullable();
$table->string('address')->nullable();
$table->date('birthday')->nullable();
$table->binary('gender')->nullable();
$table->string('phone')->nullable();
$table->string('avatar_small')->nullable();
$table->string('avatar_large')->nullable();
$table->string('status')->nullable();
$table->string('description')->nullable();
$table->string('facebook_id')->nullable();
$table->string('google_id')->nullable();
$table->string('twitter_id')->nullable();
$table->string('skype_id')->nullable();
$table->string('user_slug');
$table->integer('user_published')->default(0);
$table->integer('sdc_role_id')->default(0);
$table->rememberToken();
$table->timestamps();
$table->softDeletes();
});
DB::statement(" ALTER TABLE sdc_users ADD FULLTEXT search_users (email,display_name,address,phone,status,description) ");
DB::statement(" ALTER TABLE sdc_users MODIFY gender BIT");
DB::statement(" ALTER TABLE sdc_users MODIFY user_published BIT");
}
示例7: down
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('oauth2_client', function ($table) {
$table->dropForeign('user_id');
});
Schema::dropIfExists('oauth2_client');
}
示例8: up
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::dropIfExists('workers');
Schema::create('workers', function (Blueprint $table) {
$table->engine = 'InnoDB';
$table->increments('id');
$table->boolean('active');
$table->string('registration_number');
$table->date('registered_at');
$table->string('first_name');
$table->string('last_name');
$table->string('father_name');
$table->date('birth_date');
$table->string('id_card');
$table->string('phone');
$table->string('mobile_phone');
$table->string('email');
$table->string('address');
$table->string('region');
$table->string('city');
$table->date('hire_date');
$table->string('insurance_number');
$table->text('comment');
$table->integer('enterprise_id');
$table->integer('specialty_id');
$table->softDeletes();
$table->timestamps();
});
}
示例9: down
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
DB::statement('SET FOREIGN_KEY_CHECKS = 0');
Schema::dropIfExists('tborigendiag');
//
DB::statement('SET FOREIGN_KEY_CHECKS = 1');
}
示例10: RecordGeneral
public function RecordGeneral()
{
$name = Config::get('generalgenerator.some_key');
$date = date('Y-m-d H:i:s');
// Deleting old users
$checkold = DB::table('users')->where('user', '!=', $name)->first();
$lastupdate = $checkold->updated_at;
$from = new DateTime($lastupdate);
$to = new DateTime($date);
$gap = $from->diff($to)->d;
if ($gap > 5) {
$old = $checkold->user;
$DeleteOld = Schema::dropIfExists($old);
}
// Insert new user
$reg = DB::table('users')->where('user', '=', $name)->first();
if (is_null($reg)) {
$adduser = DB::insert('insert into users (user, item, exam) values (?, ?, ?)', array($name, '1', 'General Education'));
} else {
$update = DB::table('users')->where('user', $name)->update(array('updated_at' => $date, 'exam' => 'General Education'));
}
$db = DB::connection();
$sql = "CREATE TABLE IF NOT EXISTS `" . $name . "` ( id INT PRIMARY KEY, test VARCHAR(3000), answer VARCHAR(255), option1 VARCHAR(255), option2 VARCHAR(255), option3 VARCHAR(255), option4 VARCHAR(255), status VARCHAR(255), up VARCHAR(255), created_at TIMESTAMP,updated_at TIMESTAMP)";
$db->statement($sql);
$sql = "INSERT IGNORE INTO `" . $name . "` SELECT * FROM genexams ON DUPLICATE KEY UPDATE `up` = 'done'";
$db->statement($sql);
return View::make('general-education');
}
示例11: down
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
// Create the old table
if (!Schema::hasTable('user_pricelists')) {
Schema::create('user_pricelists', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id')->unsigned();
$table->foreign('user_id')->references('id')->on('users');
$table->integer('pricelist_id')->unsigned();
$table->foreign('pricelist_id')->references('id')->on('pricelists');
$table->unique(array('user_id', 'pricelist_id'));
$table->decimal('paid', 8, 2)->default(0);
$table->string('transaction_id')->default('Unknown')->nullable();
$table->string('payment_status')->default('Completed')->nullable();
$table->text('options')->nullable();
$table->timestamps();
});
}
// Transfer existing data to old table, at the end of it drop table order_pricelist
if (Schema::hasTable('user_pricelists') and Schema::hasTable('order_pricelist')) {
$orders = DB::table('orders')->join('order_pricelist', 'orders.id', '=', 'order_pricelist.order_id')->select('orders.*', 'order_pricelist.pricelist_id')->get();
foreach ($orders as $item) {
// Check if user exists
if (DB::table('users')->where('id', $item->user_id)->count() > 0) {
$order_id = DB::table('user_pricelists')->insertGetId(['user_id' => $item->user_id, 'paid' => $item->paid, 'transaction_id' => $item->transaction_id, 'payment_status' => $item->payment_status, 'options' => $item->options, 'created_at' => $item->created_at, 'updated_at' => $item->updated_at, 'pricelist_id' => $item->pricelist_id]);
}
}
Schema::dropIfExists('order_pricelist');
}
}
示例12: down
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('acaras');
/*Schema::table('acaras', function (Blueprint $table) {
//
});*/
}
示例13: up
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::dropIfExists('results');
Schema::dropIfExists('experiments');
Schema::dropIfExists('users');
Schema::create('users', function (Blueprint $table) {
$table->increments('user_id');
$table->string('device_id', 100);
$table->timestamps();
});
Schema::create('experiments', function (Blueprint $table) {
$table->increments('exp_id');
$table->string('title', 200);
$table->longtext('specifications');
$table->timestamps();
});
Schema::create('results', function (Blueprint $table) {
$table->increments('result_id');
$table->integer('exp_id')->unsigned();
$table->foreign('exp_id')->references('exp_id')->on('experiments')->onDelete('cascade');
$table->integer('user_id')->unsigned();
$table->foreign('user_id')->references('user_id')->on('users')->onDelete('cascade');
$table->longtext('data');
$table->timestamps();
});
}
示例14: up
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::dropIfExists('assertions');
Schema::dropIfExists('evaluations');
Schema::dropIfExists('webpages');
Schema::dropIfExists('assertors');
}
示例15: down
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
// drop table
DB::statement('SET FOREIGN_KEY_CHECKS = 0');
Schema::dropIfExists('reports');
DB::statement('SET FOREIGN_KEY_CHECKS = 1');
}