How to convert Laravel migrations to raw SQL scripts?

后端 未结 5 1399
孤独总比滥情好
孤独总比滥情好 2021-01-30 03:33

Developers of my team are really used to the power of Laravel migrations, they are working great on local machines and our dev servers. But customer\'s database admin will not a

5条回答
  •  说谎
    说谎 (楼主)
    2021-01-30 03:46

    I had to do it after --pretend, change this :

    CreateTablenameTable: create table `tablename` (`id` bigint unsigned not null auto_increment primary key, `code` varchar(255) not null, `valeur` varchar(255) not null) default character set utf8mb4 collate 'utf8mb4_unicode_ci' engine = InnoDB
    CreateTablenameTable: alter table `tablename` add unique `tablename_code_unique`(`code`)
    

    To this :

    create table tablename 
    (
    id bigint unsigned not null auto_increment primary key, 
    code varchar(255) not null, 
    valeur varchar(255) not null
    ) default character set utf8mb4 collate 'utf8mb4_unicode_ci' engine = InnoDB;
    alter table tablename add unique tablename_code_unique(code);
    

提交回复
热议问题