5h3rr1ll / Goodbuy

It’s about building a tool to raise awareness what impact your consumptions have on the plane, the society and nature and also empowers people to consume based on their own ethical and moral consumer profile.
https://goodbuy.herokuapp.com
The Unlicense
1 stars 1 forks source link

auto-increment in sql database #5

Closed 5h3rr1ll closed 5 years ago

5h3rr1ll commented 5 years ago

Whenever a new Concern, Company, Brand or Product become added to the database, the id should be set automatically and auto-increment every time.

5h3rr1ll commented 5 years ago

I wasn't able to just make the changes in the database via MySQLWorkbench. I always become this error: "19:09:29 Apply changes to companies Error 1833: Cannot change column 'id_company': used in a foreign key constraint 'fk_companies_has_brands_companies1' of table 'd025764e.companies_has_brands' SQL Statement: ALTER TABLE d025764e.companies CHANGE COLUMN id_company id_company INT(11) NOT NULL AUTO_INCREMENT" - Maybe @Darjusch you find I way to change it via changing the tables in the Django-Project and then push it the database!?