VentureCraft / revisionable

Easily create a revision history for any laravel model
http://twitter.com/duellsy
MIT License
2.55k stars 349 forks source link

Set database connection #298

Open lephleg opened 7 years ago

lephleg commented 7 years ago

Hello! Terrific package, working great even on L4!

I'd like to ask if there is an easy way to set the database connection for the revisions to be stored.

My main db is a MySQL but I'm afraid it wont be able to handle the mass number of revisions that are going to be stored so I was thinking to move the revisions table to something more performant like MongoDB using its Laravel package.

Any thoughts?

lephleg commented 7 years ago

Well I tried to define a separate database connection with a MongoDB instance on the Revisionable trait but it seems that it conflicts with my model (Report) which uses the primary MySQL connection.

Illuminate\Database\Eloquent\Model and Venturecraft\Revisionable\RevisionableTrait define the same property ($connection) in the composition of Report. However, the definition differs and is considered incompatible.
Autsider666 commented 7 years ago

I'm having the same issue.

249 Seems to give a working chance for this problem (dating 2016), but hasn't been merged (yet).