Revert "Permissions fix for migration"

This reverts commit f971b44c864c03f16c10c850ae6b34172e4155b3.
Revert "escape column names in the permissions table"

This reverts commit 49b60c2c0430b82591714c08066389f8a6b4640b.
Revert "Revert table definition on permissions migration"

This reverts commit 8460728b610cadeaf7380a25158f0d3e453667bb.
Revert "Revert change to time field in migration"

This reverts commit 8812e33a5e77dc93b1a3a3f3e7daf78cfe12da18.
Revert "Remove raw SQL from migrations"

This reverts commit 127beb31ff49b3bbd693d19d16c22c4a95ec9f0a.