Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
95edabb4
Kaydet (Commit)
95edabb4
authored
Eyl 19, 2015
tarafından
Flavio Curella
Kaydeden (comit)
Tim Graham
Eyl 19, 2015
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #25430 -- Fixed incorrect RunSQL examples.
üst
c3904deb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
migration-operations.txt
docs/ref/migration-operations.txt
+4
-4
No files found.
docs/ref/migration-operations.txt
Dosyayı görüntüle @
95edabb4
...
...
@@ -218,8 +218,8 @@ queries and parameters in the same way as :ref:`cursor.execute()
<executing-custom-sql>`. These three operations are equivalent::
migrations.RunSQL("INSERT INTO musician (name) VALUES ('Reinhardt');")
migrations.RunSQL([
"INSERT INTO musician (name) VALUES ('Reinhardt');", None
])
migrations.RunSQL([
"INSERT INTO musician (name) VALUES (%s);", ['Reinhardt']
])
migrations.RunSQL([
("INSERT INTO musician (name) VALUES ('Reinhardt');", None)
])
migrations.RunSQL([
("INSERT INTO musician (name) VALUES (%s);", ['Reinhardt'])
])
If you want to include literal percent signs in the query, you have to double
them if you are passing parameters.
...
...
@@ -228,8 +228,8 @@ The ``reverse_sql`` queries are executed when the migration is unapplied, so
you can reverse the changes done in the forwards queries::
migrations.RunSQL(
[
"INSERT INTO musician (name) VALUES (%s);", ['Reinhardt']
],
[
"DELETE FROM musician where name=%s;", ['Reinhardt']
],
[
("INSERT INTO musician (name) VALUES (%s);", ['Reinhardt'])
],
[
("DELETE FROM musician where name=%s;", ['Reinhardt'])
],
)
The ``state_operations`` argument is so you can supply operations that are
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment