Commit 17785222188a8eea202d02036390b8214fd559f3
1 parent
c6086633
Exists in
master
and in
39 other branches
Minor fixes and changes on attachments
Showing
2 changed files
with
3 additions
and
3 deletions
Show diff stats
src/proxy/migrations/0003_create_attachment_view.py
| ... | ... | @@ -15,7 +15,7 @@ class Migration(DataMigration): |
| 15 | 15 | cursor.execute(''' |
| 16 | 16 | CREATE OR REPLACE VIEW attachment_view AS SELECT |
| 17 | 17 | CONCAT(attachment.type, '/' , attachment.id, '/', attachment.filename) AS url, |
| 18 | - attachment.type AS type, | |
| 18 | + attachment.type AS used_by, | |
| 19 | 19 | attachment.filename as filename, |
| 20 | 20 | (SELECT LOWER(SUBSTRING(attachment.filename FROM '\w{2,3}$'))) AS mimetype, |
| 21 | 21 | attachment.author as author, |
| ... | ... | @@ -29,7 +29,7 @@ class Migration(DataMigration): |
| 29 | 29 | connection = connections['trac'] |
| 30 | 30 | |
| 31 | 31 | cursor = connection.cursor() |
| 32 | - cursor.execute('DROP VIEW attachment_view;') | |
| 32 | + cursor.execute('DROP VIEW IF EXISTS attachment_view;') | |
| 33 | 33 | |
| 34 | 34 | models = { |
| 35 | 35 | u'proxy.attachment': { | ... | ... |
src/proxy/models.py
| ... | ... | @@ -8,7 +8,7 @@ from hitcount.models import HitCountModelMixin |
| 8 | 8 | |
| 9 | 9 | class Attachment(models.Model, HitCountModelMixin): |
| 10 | 10 | url = models.TextField(primary_key=True) |
| 11 | - type = models.TextField() | |
| 11 | + used_by = models.TextField() | |
| 12 | 12 | filename = models.TextField() |
| 13 | 13 | author = models.TextField(blank=True) |
| 14 | 14 | description = models.TextField(blank=True) | ... | ... |