I'm surprised to see this suggestion of storing a SQLite db in version 
control.  Don't you quickly run into problems where two developers each 
write new data to the database, and then cannot merge their changes?  Or 
do you have a read-only database?

--Ned.
http://nedbatchelder.com/blog

Brian Luft wrote:
> Simon's method is a good way to go.  In general its a good idea to use
> some sort of scheme for managing all of the changes that occur to the
> base schema in revision control.  This way you can pull down a tagged
> copy of your source tree, run the CREATE DATABASE script, and run the
> alter script(s) associated with that revision so that you can create
> the appropriate schema for any point in time.  This is a discussion
> unto itself, but hopefully you get the idea.
>
> Another "less hassle" alternative you might consider is to use a
> sqlite database.  Create the database file in your project root.  Then
> in your settings file do something like:
>
> DATABASE_NAME = os.path.join(os.path.dirname(__file__), 'data',
> 'our_database.db')
>
> Now you will be keeping your entire database in a file that will be
> managed by revision control.  One potential disadvantage is that
> you'll be working with the same exact data (at least from the moment
> you do an "update" and receive a new version of the sqlite database
> file).  But if you're in the early stages of development, this
> presents an easy way for other developers to receive any changes you
> make to the schema without having to worry about applying SQL scripts
> and dealing with any possible data transformations.  I wouldn't call
> this a "best practice" per se - more of a "simple" practice you can
> take advantage of until your schema stabilizes.  At that point in time
> just do the "manage dumpdata/loaddata" dance to get your data out of
> sqlite and into your DB of choice.
>
> -Brian
>
> On Apr 2, 9:04 pm, Simon  Oberhammer <[EMAIL PROTECTED]>
> wrote:
>   
>>> that developer has to inform all others of the changes so they all
>>> make the change manually on their own local database.
>>>       
>> you could have a mysql-changes.sql file in your app directories. it
>> holds the ALTER, DROP, etc. statements. put it under SVN. when you get
>> a new rev with the comment "db changed blabla", look at the diff to
>> see what changes need to get applied to the DB.
>>     
> >
>
>   

-- 
Ned Batchelder, http://nedbatchelder.com


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to