Browse Source

Migration PGSQL

omassot 7 năm trước cách đây
mục cha
commit
0fa60497d3
5 tập tin đã thay đổi với 10 bổ sung6 xóa
  1. 6 3
      backlog/settings.py
  2. BIN
      db.sqlite3
  3. 0 0
      dump.json
  4. 1 1
      main/models.py
  5. 3 2
      requirements.txt

+ 6 - 3
backlog/settings.py

@@ -76,9 +76,12 @@ WSGI_APPLICATION = 'backlog.wsgi.application'
 
 DATABASES = {
     'default': {
-        'ENGINE': 'django.db.backends.sqlite3',
-#         'NAME': r'\\p-app-4\E\Backlog\backlog_db.sqlite3',
-        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
+        'ENGINE': 'django.db.backends.postgresql',
+        'NAME': 'backlog',                      
+        'USER': 'backlog',
+        'PASSWORD': 'backlog',
+        'HOST': 'localhost',
+        'PORT': '5432',
     }
 }
 

BIN
db.sqlite3


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dump.json


+ 1 - 1
main/models.py

@@ -114,7 +114,7 @@ class Sprint(BaseModel):
                                 FROM main_story_sprints 
                                 GROUP BY story_id) as last_sprints 
                     ON main_story.id = last_sprints.story_id
-                WHERE last_sprints.sprint_id = {} AND closed = 1;
+                WHERE last_sprints.sprint_id = {} AND closed = True;
             """.format(self.id)
         with connection.cursor() as cursor:
             cursor.execute(sql)

+ 3 - 2
requirements.txt

@@ -1,3 +1,4 @@
-Django
-martor
+psycopg2
+Django
+martor
 path.py>=11.1.0

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác