Changes between Initial Version and Version 1 of Ticket #34877
- Timestamp:
- Sep 27, 2023, 2:14:35 PM (14 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #34877 – Description
initial v1 1 Trying to get SQL code for a migration s I receive a `KeyEorr`1 Trying to get SQL code for a migration I receive a `KeyError`. 2 2 3 3 **Model** 4 5 Example of a model with a `GenratedField`. 4 6 5 7 {{{#!python … … 20 22 **Step** 21 23 24 Generate the migration file: 25 22 26 {{{#!bash 23 27 $ python -m manage makemigrations 28 }}} 29 30 Steps to generate the error: 31 32 {{{#!bash 24 33 $ python -m manage sqlmigrate shop 0001 34 }}} 35 36 Similar error with another command: 37 38 {{{#!bash 39 $ python -m manage migrate shop 0001 25 40 }}} 26 41 … … 78 93 }}} 79 94 95 **Expected result** 96 97 {{{#!sql 98 BEGIN; 99 -- 100 -- Create model Item 101 -- 102 CREATE TABLE "shop_item" ( 103 "id" bigint NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, 104 "price" numeric(7, 2) NOT NULL, 105 "vat_price" numeric(8, 2) GENERATED ALWAYS AS (ROUND(("price" * 1.22), 2)) STORED 106 ); 107 COMMIT; 108 }}}