mirror of https://github.com/interlegis/sapl.git
4 changed files with 61 additions and 0 deletions
@ -0,0 +1,23 @@ |
|||||
|
from __future__ import unicode_literals |
||||
|
|
||||
|
from django.db import migrations |
||||
|
|
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
|
||||
|
dependencies = [ |
||||
|
('materia', '0055_auto_20190816_0943'), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
migrations.RunSQL(""" |
||||
|
create or replace view materia_materiaemtramitacao as |
||||
|
select m.id as id, |
||||
|
m.id as materia_id, |
||||
|
t.id as tramitacao_id |
||||
|
from materia_materialegislativa m |
||||
|
inner join materia_tramitacao t on (m.id = t.materia_id) |
||||
|
where t.id = (select max(id) from materia_tramitacao where materia_id = m.id) |
||||
|
order by m.id DESC |
||||
|
"""), |
||||
|
] |
||||
@ -0,0 +1,25 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
# Generated by Django 1.11.20 on 2019-08-27 20:13 |
||||
|
from __future__ import unicode_literals |
||||
|
|
||||
|
from django.db import migrations, models |
||||
|
|
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
|
||||
|
dependencies = [ |
||||
|
('materia', '0056_popula_materiaemtramitacao'), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
migrations.CreateModel( |
||||
|
name='MateriaEmTramitacao', |
||||
|
fields=[ |
||||
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
||||
|
], |
||||
|
options={ |
||||
|
'db_table': 'materia_materiaemtramitacao', |
||||
|
'managed': False, |
||||
|
}, |
||||
|
), |
||||
|
] |
||||
Loading…
Reference in new issue