interchange / interchange6-schema

DBIC schema for Interchange 6
8 stars 7 forks source link

orders.users_id should be nullable #92

Closed murwiz closed 9 years ago

murwiz commented 10 years ago

The "users_id" field in the "orders" table should be nullable. Not all checkouts will require a user to log in (either to a permanent account or a temporary account), so it should be possible to create an order without an associated user.

racke commented 10 years ago

I disagree, as you can always create an user in the "background". You can hide that completely from the frontend (use a role for these users with no permissions).

Also in most cases shops are using users and I don't think this use case warrants more complexity. So what is your actual usecase/objective to not use user records for orders?

SysPete commented 10 years ago

Maybe we could add a boolean column somthing like "is_virtual" (better suggestions please) to User to make these background users easy to track. I could add code to overloaded new on User that allocates a dummy username when called with is_virtual=>1 and then these can be cleaned up later via cron when now()-created > '24 hours' (or whatever).

rmtemplet commented 10 years ago

I don't mind is_virtual. It could be is_anonymous but I'm kind of meh on that one.

I do like having some way to tell that they aren't "real" customer logins. In IC5 we could do that kind of by searched for all that started with U and followed bu nothing but digits and hoping we didn't erase any real accounts. It also bit us in the end when the counter flipped from U to V. :)