etsy / 411

An Alert Management Web Application
https://demo.fouroneone.io
MIT License
971 stars 112 forks source link

Error creating new user #82

Closed AGirin closed 8 years ago

AGirin commented 8 years ago

image

I assume I need new schema? How do I update my existing installation?

kiwiz commented 8 years ago

There's a migration script: https://github.com/etsy/411/blob/master/docs/Upgrading.md.

I made a change to the config format for indices. Check out config_example.php for details.

AGirin commented 8 years ago

Well - I actually just ran it and got this:

bin/migration.php:

Migrating from 1.0.1 to 1.1.0 PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes' in /var/www/411/phplib/DB.php:103 Stack trace:

0 /var/www/411/phplib/DB.php(103): PDOStatement->execute()

1 /var/www/411/bin/migration.php(53): FOO\DB::query('CREATE UNIQUE I...')

2 {main}

thrown in /var/www/411/phplib/DB.php on line 103

AGirin commented 8 years ago

Ran it second time and got this:

Migrating from 1.0.1 to 1.1.0 PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'api_key'' in /var/www/411/phplib/DB.php:103 Stack trace:

0 /var/www/411/phplib/DB.php(103): PDOStatement->execute()

1 /var/www/411/bin/migration.php(48): FOO\DB::query('ALTER TABLE `us...')

2 {main}

thrown in /var/www/411/phplib/DB.php on line 103

AGirin commented 8 years ago

I was able to create user after that but still not sure if I need to do something about those errors. I assume something will be broken.

kiwiz commented 8 years ago

Oh, hmm. The migration script has a different length than the sql files. That should be fine as long as you don't use the API.

If you're planning on doing so at some point, you'll need to alter the api_key field so it's 64 characters long and add the key.

AGirin commented 8 years ago

Well - I see that this was somehow created by the first run even though it gave me an error. Does this look right to you?

image

kiwiz commented 8 years ago

api_key should have a length of 64 bytes. Looks fine otherwise.