Add rows in migrations?

35 views
Skip to first unread message

Victor Porton

unread,
Oct 4, 2016, 7:21:07 PM10/4/16
to Django users
After generating DB scheme, I need to add two rows with certain data to certain table.

How to do it?

Can it be handled with migrations?

A complication is that these two rows contain strings dependent on the user's language.

Can this be done?

Avraham Serour

unread,
Oct 5, 2016, 12:56:58 AM10/5/16
to django-users
which user?

a user usually is known during a request, while running the migration there are no users, you can access all users the same way you may access all the database, but this is not a user requested operation like a view processing a template.

In any case you still may add/remove/modify data running migration, this is called data migration


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/017c3db6-ae9f-48fa-ad81-2e0a1fccb459%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mario R. Osorio

unread,
Oct 5, 2016, 9:26:01 AM10/5/16
to Django users
Reply all
Reply to author
Forward
0 new messages