My migrations aren't running!

I had a pretty frustrating experience today. It goes a little something like this:


Working on client website Realizes that database needs to be setup Creates some migrations and models ...runs them

Errors

What the hell?

ER_TABLE_NOT_FOUND

Um, what? Of course the damn table isn't going to be found, it's supposed to create it!

Tries the same command several times in hopes of a different outcome...nothing

Sigh, okay. Maybe the maintainer screwed something up.

Creates an issue ...few hours lateeeeer

Maintainer: It's this.create not this.table, this.table is for altering the table.

Oh.

...Okay.

Cool.

Alright.

After bashing self for blatant idiocy, thanks maintainer and closes issue

Makes changes to code

Runs the migrations

Errors

OH MY FUCKING GOD, WHAT THE HELL!

Column name is too long

Er..okay.. Simple fix I guess.

Quick trip to Stack Overflow reveals I just need to change a setting

Changes setting

Runs migrations

Errors

...

Completely ambiguous error

What. The. Fuck.

...few hours lateeer [after many failures...]

FUCK YOU MARIADB, FUCK EVERYTHING, DAMMIT MYSQL HERE I FUCKING COME!

Uninstalls MariaDB

Installs mysql-server

...installing... ...installing... ...installing...

Errors

Oh my god, I really don't have time for this!

...few hours later [after taking multiple trips to Stack Overflow, mysql installed]

Runs migrations

...

Errors

FU....- Oh. Just missing the database. Okay. Alright. Simple Fix

Logs into phpmyadmin, goes to create database

Errors

Oh my god, what the hell could it be now??

phpmyadmin was specifically configured for mariadb

Alright. Fine. Let's just reinstall it then.

Uninstalls phpmyadmin

...

Installs phpmyadmin

Okay. How about now?

Errors

UGHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH

phpmyadmin never invoked dbconfig-common so the main database is missing

Ah okay. Let's just run it ourselves then

Runs dbconfig-common

Tries creating database again

Errors

dbcommon-config only created the database, none of the core tables

Fuck! Okay.

Quick trip to Stack Overflow

Oh right. I can just run the bootstrap SQL code myself.

Finds the file, copy pastes into phpmyadmin and runs

...

Errors

Specific table doesn't exist

WELL OF FUCKING COURSE THE GOD DAMN TABLE DOESN'T EXIST, I HAVEN'T MADE IT YET!

Creates table

Runs SQL code again

... ... ...

Successful

OH THANK GOD!

Already lost all motivation for what needed to be done originally


Story of my life. Every. Fucking. Time.

Thanks for reading, hope you enjoyed!

(PS. This is a true story.)