Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

user_character.isMain does not have a default value #86

Closed
a-tal opened this issue Jan 23, 2016 · 2 comments
Closed

user_character.isMain does not have a default value #86

a-tal opened this issue Jan 23, 2016 · 2 comments
Assignees
Milestone

Comments

@a-tal
Copy link

a-tal commented Jan 23, 2016

when trying to add a new api key to a new install, on the page where you enter it, it doesn't allow you to go to the character select page instead giving an error about how there's no default value for isMain.

confirmed the lack of default in MySQL:

mysql> show columns in user_character;
+-------------+------------+------+-----+-------------------+----------------+
| Field       | Type       | Null | Key | Default           | Extra          |
+-------------+------------+------+-----+-------------------+----------------+
| id          | int(11)    | NO   | PRI | NULL              | auto_increment |
| created     | timestamp  | YES  | MUL | CURRENT_TIMESTAMP |                |
| updated     | timestamp  | YES  | MUL | CURRENT_TIMESTAMP |                |
| active      | tinyint(1) | NO   | MUL | 1                 |                |
| userId      | int(11)    | YES  | MUL | NULL              |                |
| apiId       | int(11)    | YES  | MUL | NULL              |                |
| characterId | int(11)    | YES  | MUL | NULL              |                |
| isMain      | tinyint(1) | NO   | MUL | NULL              |                |
+-------------+------------+------+-----+-------------------+----------------+

after running alter table user_character modify column isMain tinyint(1) not null default 0; I was able to input an api key and select a main.

https://github.com/exodus4d/pathfinder/blob/master/app/main/model/usercharactermodel.php#L60

@exodus4d
Copy link
Owner

Oh thanks, i forgot the default value for that column.
Set nullable to false without providing any default value, does not make sense. Unfortunately I don´t see those errors on my installations.
To make it more consistent, i changed all default column values for boolean fields (which are actual converted into tinyint(1)), from bool (true/false) into (1/0).

@exodus4d exodus4d self-assigned this Jan 23, 2016
@exodus4d exodus4d added this to the v 1.0.0RC2 milestone Jan 23, 2016
@a-tal
Copy link
Author

a-tal commented Jan 23, 2016

great, thanks! I've confirmed this is now resolved in the develop branch.

(btw, if you ever want a docker container to test things with... https://github.com/a-tal/pathfinder-docker)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants