Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision bc8ddcc1

Von Tamino Steinert vor 12 Monaten hinzugefügt

  • ID bc8ddcc1e89d5a73e60af488d21e2bb0ec000cad
  • Vorgänger 93b347a8
  • Nachfolger 8a0d2996

Varianten: alle Artikeltypen ermöglichen

Unterschiede anzeigen:

sql/Pg-upgrade2/add_variants.sql
3 3
-- @depends: release_3_8_0
4 4
-- @ignore: 0
5 5

  
6
ALTER TYPE part_type_enum ADD VALUE 'parent_variant';
7
ALTER TYPE part_type_enum ADD VALUE 'variant';
8

  
9
ALTER TABLE defaults ADD parent_variant_number TEXT;
10
ALTER TABLE defaults ADD variant_number TEXT;
6
CREATE TYPE part_variant_type AS ENUM ('single', 'parent_variant', 'variant');
7
ALTER TABLE parts ADD COLUMN variant_type part_variant_type DEFAULT 'single' NOT NULL;
11 8

  
12 9
CREATE TABLE parts_parent_variant_id_parts_variant_id (
13 10
  parent_variant_id INTEGER NOT NULL        REFERENCES parts(id),
......
20 17
  name         TEXT       NOT NULL,
21 18
  unique_name  TEXT       NOT NULL UNIQUE,
22 19
  abbreviation VARCHAR(4) NOT NULL,
20
  sortkey      INTEGER,
23 21
  itime        TIMESTAMP DEFAULT now(),
24 22
  mtime        TIMESTAMP
25 23
);
......
50 48
  variant_property_id INTEGER NOT NULL REFERENCES variant_properties(id),
51 49
  value               TEXT    NOT NULL,
52 50
  abbreviation        VARCHAR(4) NOT NULL,
53
  sortkey             INTEGER NOT NULL,
51
  sortkey             INTEGER,
54 52
  itime               TIMESTAMP DEFAULT now(),
55 53
  mtime               TIMESTAMP
56 54
);

Auch abrufbar als: Unified diff