The migrations are run one time to set up the models (or anything else), 
they don't represent the current state of the models.  In general, we use 
either the Admin to edit models, in which case we export the schema as edn 
to migrate between different environments, or we use the built in 
migrations and leave the admin models alone.  But there is no reason you 
couldn't use both.  

If you are looking for something to represent the current state of the 
model schema, you want the export API, which renders your current schema as 
an edn file which can be applied to any database universally.  

In general, there is always a potential disconnect between the schema and 
the code in any system.  If you have model descriptors, nothing guarantees 
your schema conforms to that.  You have to run migrations that line up with 
your model descriptions.  In Caribou, the database contains the model 
descriptions, and the system just reads those descriptions from the db to 
construct the models that the rest of the code is using.  So in a way, the 
Caribou models always reflect the state of the db, and don't depend on code 
to describe something that may not be in sync with what is in the db in the 
first place.  

It is different from any system I have seen though, so I understand your 
confusion!  Part of our challenge is providing a way to explain this 
clearly and to mitigate any issues that could arise from this approach.  

On Sunday, November 17, 2013 2:02:07 PM UTC-8, puzzler wrote:
>
> On Sun, Nov 17, 2013 at 1:58 PM, Ryan Spangler 
> <ryan.s...@gmail.com<javascript:>
> > wrote:
>
>> There are many advantages to this, including being able to generate the 
>> admin and api automatically, (as well as letting our frontend guys add 
>> properties they need in a model without pestering the backend guys to make 
>> schema updates!).  If manipulating schemas through the admin makes you 
>> nervous, you can always write migrations for your model changes: 
>> http://caribou.github.io/caribou/docs/migrations.html
>>
>
> I'm a little confused about this.  If you write some code to set up 
> models, and then you make changes to the admin interface, isn't your code 
> out-of-sync with the underlying reality? 
>  

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to