Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

int not big enough #340

Open
FayeG opened this issue Jun 6, 2016 · 4 comments
Open

int not big enough #340

FayeG opened this issue Jun 6, 2016 · 4 comments
Labels
Milestone

Comments

@FayeG
Copy link

FayeG commented Jun 6, 2016

Hi,

We're using the Mysql backend to puppet dashboard.

We recently hit the problem that column "id" in the table resource_statuses was an "int" and not a "bigint" so we ran out of ids to use.

Please could this be fixed. ie. when the table is created in future releases and as a recommendation pre updated. Here's the steps we took to resolve it:

mysql> alter table resource_events drop foreign key fk_resource_events_resource_status_id;
mysql> ALTER TABLE resource_statuses MODIFY COLUMN id BIGINT;
…… long wait ……
mysql> ALTER TABLE resource_events MODIFY COLUMN resource_status_id BIGINT;
mysql> alter table resource_events add CONSTRAINT fk_resource_events_resource_status_id FOREIGN KEY (resource_status_id) REFERENCES resource_statuses (id) ON DELETE CASCADE;
mysql> ALTER TABLE resource_statuses MODIFY COLUMN id BIGINT NOT NULL AUTO_INCREMENT;

@bwitt
Copy link
Collaborator

bwitt commented Aug 11, 2016

I had to do this for metrics table as well
alter table metrics change id id bigint not null auto_increment;

@bwitt
Copy link
Collaborator

bwitt commented Aug 22, 2018

let's add a migration to fix this

@ZeroPointEnergy ZeroPointEnergy added this to the Release 3.1 milestone Sep 11, 2018
@unixman99
Copy link

yes, I had this happen too, altering the tables didn't seem to fix it for me though, had to db:drop and db:create to get past it.

@crispygoth
Copy link
Contributor

Just came across this myself, although I'm using postgres. Thought I'd add a note to let you know it's not just a MySQL issue.

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

No branches or pull requests

5 participants