This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE DEFINER=`root`@`root` PROCEDURE `procedure_name`() | |
BEGIN | |
IF (SELECT count(*) | |
FROM information_schema.TABLES | |
WHERE | |
TABLE_SCHEMA = 'DB_NAME' -- Database name | |
AND TABLE_NAME = 'TABLE_NAME' AND ...) = 0 THEN | |
SELECT ...; -- not exists | |
ELSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// REGIONS | |
Schema::create('regions', function (Blueprint $table) { | |
$table->increments('id'); | |
$table->tinyInteger('code')->unique(); | |
$table->string('title', 25)->unique(); | |
$table->string('image'); | |
$table->string('description', 100); | |
$table->timestamps(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (! function_exists('dbd')) { | |
/** | |
* Showing all database queries. | |
* Отображение всех запросов в базу. | |
* | |
* @param null|\Illuminate\Console\Command|\Psr\Log\LoggerInterface $channel | |
*/ | |
function dbd($channel = null) |