Re: database migrations

2019-08-04 Thread Mike Dewhirst
Once I have a database I wish to replicate many times for testing I just use pg_dump to create a json file which can be reloaded into an empty database as often as required. For that I use a script which sequentially calls dropdb, createdb and finally psql which nominates the json dump file

Re: database migrations

2019-08-04 Thread Jani Tiainen
Hi. To me this sounds more debugging issue than migrations or database problem. Since it is most definitely your code that doesn't work right. Of course if youre building and testing features that fill thousands of entries or relatively complex data there are options. Personally I use

Re: database migrations

2019-08-04 Thread Perceval Maturure
Thanks Roger. On Sun, 04 Aug 2019 at 01:19, RLM wrote: > Why try to avoid re populating the database? That's the easy part, > figuring what went wrong is more difficult.You don't need a lot of data to > get an app working, you just need to understand what you want and how to > achieve it. > >

Re: database migrations

2019-08-03 Thread RLM
Why try to avoid re populating the database? That's the easy part, figuring what went wrong is more difficult.You don't need a lot of data to get an app working, you just need to understand what you want and how to achieve it. When I was learning django I rebuilt my events database 20 times

Re: database migrations

2019-08-03 Thread Perceval Maturure
Question is what’s the best way forward to avoid situations where u will have to create a new database if ur applications do not work with the current databases so as to avoid populating the database with data again Sent from my iPhone > On 02 Aug 2019, at 14:39, Perceval Maturure wrote: >

Re: database migrations

2019-08-03 Thread Jani Tiainen
Hi. So... what is the actual question? pe 2. elok. 2019 klo 15.40 Perceval Maturure kirjoitti: > Dear all > creating a new database as applications increase has been one of the > solutions to some of the errors i have encountered especially after adding > a django cms by hand in my development

database migrations

2019-08-02 Thread Perceval Maturure
Dear all creating a new database as applications increase has been one of the solutions to some of the errors i have encountered especially after adding a django cms by hand in my development environment. i cant imagine a situation like that in a production environment as this will mean re-entry

Database migrations

2016-03-04 Thread Daniel Roseman
What are you expecting to happen? The message is quite clear, and offers the only two possible options. Are neither of those suitable? Why not? What other action would you like to take? -- DR. -- You received this message because you are subscribed to the Google Groups "Django users" group.

Database migrations

2016-03-04 Thread raoul
Hi all, I have been playing around with Django now for a couple of weeks I have been adding apps to my project and one point of frustration is the migration. When there are PK and/or FK relations: You are trying to add a non-nullable field 'user' to user without a default; we can't do that

Re: I'm missing something with Models and database migrations

2016-01-02 Thread Michael Molloy
Thank you both. --M On Monday, December 28, 2015 at 1:09:08 AM UTC-6, Peter of the Norse wrote: > > OK. Let’s take a look at the documentation > . > > Here is what you are looking for: > >

Re: I'm missing something with Models and database migrations

2015-12-27 Thread Peter of the Norse
OK. Let’s take a look at the documentation . Here is what you are looking for: class Invoice(models.Model): invoice_date = models.DateField(‘created date’, auto_now=True) line_item_set =

Re: I'm missing something with Models and database migrations

2015-12-23 Thread Vijay Khemlani
If you want to make the middle table by yourself then those ManyToManyField need to be ForeignKey instead. On Wed, Dec 23, 2015 at 2:33 AM, Michael Molloy wrote: > I figured it out, again with help from Vijay. Thanks for getting me > thinking in the right direction. > > So

Re: I'm missing something with Models and database migrations

2015-12-22 Thread Michael Molloy
I figured it out, again with help from Vijay. Thanks for getting me thinking in the right direction. So here is my cross reference model: class Invoice_Line_Items(models.Model): created_dt = models.DateField('created date', auto_now=True) invoice = models.ManyToManyField(Invoices) line_item

Re: I'm missing something with Models and database migrations

2015-12-22 Thread Michael Molloy
Still confused. I think I still need to create the cross reference Django model myself, and then use makemigrations to turn it into a table. I need a place to store invoices and associated line items, so if the model code I put in my first post is incorrect, what should it look like?

Re: I'm missing something with Models and database migrations

2015-12-22 Thread Michael Molloy
I was trying to create the cross reference table myself. I'm coming at this from a java/oracle background where I would create two tables (invoices and line_items), and then a third (invoice_line_item_xref) that would contain invoice IDs and associated line item IDs. I think you just helped me

Re: I'm missing something with Models and database migrations

2015-12-22 Thread Vijay Khemlani
You have two pairs of fields with the same name (line_item_id and invoice_id), what are you trying to do exactly? Why the IntegerFields? In a Many To Many relation the columns are added to a third table between the models. On Tue, Dec 22, 2015 at 9:20 PM, Michael Molloy

I'm missing something with Models and database migrations

2015-12-22 Thread Michael Molloy
Python 3.3 and Django 1.8 running on Openshift with a Postgresql database I'm trying to set up an Invoices table, a Line_Item table, and a cross reference between them. Here are the relevant models: class Invoices(models.Model): invoice_date = models.DateField('created date', auto_now=True)