ekmungai / eloquent-ifrs

Eloquent Double Entry Accounting with a focus on IFRS Compliant Reporting
MIT License
332 stars 67 forks source link

Two users table ? #157

Closed iammemon closed 5 months ago

iammemon commented 6 months ago

The package creates a new user table with the prefix and suggests using the ModelTablePrefix trait in the user model to point eloquent to the new table. But what about the existing users and foreign keys?

I can fix it by skipping the ModelTablePrefix trait and manually adding the entity_id column in the original user table. But why does it default to this behavior in the first place?

ekmungai commented 6 months ago

Hi @iammemon,

That was the original behaviour in a much earlier version of the package, but it was pointed out that someone might want to keep the users from an existing application separate from the new ifrs functionality hence the trait. A simple solution for dealing with existing users/relationships is to add a one to one relationship between the existing users and the ifrs users and then access one or the other from either side.

Cheers, Edward