mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 01:39:18 +02:00
Implement tag models
This commit is contained in:
parent
c170ee9394
commit
6dde4b73cd
28 changed files with 1034 additions and 141 deletions
22
api/funkwhale_api/common/migrations/0003_cit_extension.py
Normal file
22
api/funkwhale_api/common/migrations/0003_cit_extension.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
# Generated by Django 2.0.2 on 2018-02-27 18:43
|
||||
from django.db import migrations
|
||||
from django.contrib.postgres.operations import CITextExtension
|
||||
|
||||
|
||||
class CustomCITExtension(CITextExtension):
|
||||
def database_forwards(self, app_label, schema_editor, from_state, to_state):
|
||||
check_sql = "SELECT 1 FROM pg_extension WHERE extname = 'citext'"
|
||||
with schema_editor.connection.cursor() as cursor:
|
||||
cursor.execute(check_sql)
|
||||
result = cursor.fetchall()
|
||||
|
||||
if result:
|
||||
return
|
||||
return super().database_forwards(app_label, schema_editor, from_state, to_state)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [("common", "0002_mutation")]
|
||||
|
||||
operations = [CustomCITExtension()]
|
Loading…
Add table
Add a link
Reference in a new issue