blueimpact / kucipong

BSD 3-Clause "New" or "Revised" License
5 stars 2 forks source link

Change Store to have an integer ID instead of an email address. #147

Closed cdepillabout closed 7 years ago

cdepillabout commented 7 years ago

This PR changes the store table to have an integer ID instead of an email address.

This ends up affecting many different areas of the code base, but it is basically a mechanical transformation.

With this change, the Admin user can delete a Store and recreate another Store with the same email address. This fixes #141.

In order to get this PR to run, you will probably have to run the following sql statements to drop the old store table.

drop table coupon cascade;
drop table store_login_token cascade;
drop table store cascade;
drop table store_email cascade;
arowM commented 7 years ago

@cdepillabout I guess this PR does not contain any code to ensure no same email address already exists when admin users try to add new store. It enables admin user to accidentally disable existing store account by adding same email address as a new store user as following flow describes.

  1. An existing store user logs out after POSTing some data in store page
  2. An admin user accidentally adds existing store email as a new store user
  3. When the store user above tries to login, it means try of logging in as a new store user account created in second step.
    • It causes that existing store data is not accessable now...

Is it in another PR? If so, please merge this PR.

cdepillabout commented 7 years ago

@arowM You're right! I'll go ahead and merge this PR in. I'll fix the bug you mentioned in a future PR. Thanks for checking!