eleven26

  • Home
  • Tags100
  • Archives346
  • Table of Contents
  • Overview

eleven26

346 posts
100 tags

Laravel Schema 查看索引是否存在

Posted on 2019-03-21
1
2
3
4
5
6
7
Schema::connection('')->table($tableName, function (Blueprint $table) {
$sm = Schema::getConnection()->getDoctrineSchemaManager();
$indexesFound = $sm->listTableIndexes('table');

if(array_key_exists("index_name", $indexesFound))
$table->dropUnique("index_name");
});
Laravel PHP
Laravel 命令行测试 Uncaught ReflectionException Class config does not exist
composer require 安装本地路径包
© 2025 eleven26
Powered by Hexo & NexT.Mist
0%