|
3 | 3 | -- Área por estado: https://pt.wikipedia.org/wiki/Lista_de_unidades_federativas_do_Brasil_por_área
|
4 | 4 | -- População por estado (prévio censo 2022): https://pt.wikipedia.org/wiki/Lista_de_unidades_federativas_do_Brasil_por_população
|
5 | 5 |
|
6 |
| -drop table if exists cliente; |
7 |
| -drop table if exists funcionario; |
8 |
| -drop table if exists loja; |
9 | 6 | drop table if exists item_venda;
|
10 | 7 | drop table if exists venda;
|
| 8 | + |
| 9 | +drop table if exists cliente; |
| 10 | +drop table if exists funcionario; |
11 | 11 | drop table if exists estoque;
|
12 | 12 | drop table if exists produto;
|
13 | 13 | drop table if exists marca;
|
14 | 14 |
|
| 15 | +drop table if exists loja; |
15 | 16 | drop table if exists cidade;
|
16 | 17 | drop table if exists estado;
|
17 | 18 | drop table if exists regiao_geografica;
|
@@ -147,15 +148,15 @@ END;
|
147 | 148 | $$ LANGUAGE 'plpgsql';
|
148 | 149 |
|
149 | 150 |
|
150 |
| -CREATE OR REPLACE TRIGGER diminui_estoque_trigger |
| 151 | +CREATE TRIGGER diminui_estoque_trigger |
151 | 152 | AFTER INSERT ON item_venda
|
152 | 153 | FOR EACH ROW EXECUTE PROCEDURE diminui_estoque_func();
|
153 | 154 |
|
154 |
| -CREATE OR REPLACE TRIGGER devolve_estoque_trigger |
| 155 | +CREATE TRIGGER devolve_estoque_trigger |
155 | 156 | AFTER DELETE ON item_venda
|
156 | 157 | FOR EACH ROW EXECUTE PROCEDURE devolve_estoque_func();
|
157 | 158 |
|
158 |
| -CREATE OR REPLACE TRIGGER atualiza_estoque_trigger |
| 159 | +CREATE TRIGGER atualiza_estoque_trigger |
159 | 160 | AFTER UPDATE ON item_venda
|
160 | 161 | FOR EACH ROW EXECUTE PROCEDURE atualiza_estoque_func();
|
161 | 162 |
|
|
0 commit comments