cirandas.net

ref: master

config/export_data.yml


  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
options:
  embed_files: true

sources:
  - type: Enterprise
    id: 5
    associations:
      - image
      - boxes:
        - blocks
      - orders
      - articles
      - products:
        - product_category
        - image
        - unit
        - product_qualifiers
        - qualifiers
        - certifiers

# replace attributes' value (oldid: newid and other: id) and set parent association
targets:
  ProductCategory:
    8: 16268
    18: 3443
    15: 4136
    9: 1746
    22: 3821
    10: 4230
    1: 16254
    14: 3594
    17: 3534
    2: 16259
    12: 3521
    11: 87
    other: 16281
  Enterprise:
    environment_id:
      1: 2
    home_page_id:
      other: ---
    image_id:
      other: ---
    identifier:
      redemoinho: rede-moinho2
    theme:
      other: rede-moinho
    visible:
      other: true
  Product:
    belongs_to: profile
  Article:
    thumbnails_processed:
      other: false
    last_changed_by_id:
      other: 87
    belongs_to: profile
  Image:
    thumbnails_processed:
      other: false
  ShoppingCartPlugin::PurchaseOrder:
    belongs_to: seller
    customer_id:
      other: ---
  Box:
    belongs_to: owner
  Block:
    belongs_to: box
  Qualifier:
  Certifier:

models_options:
  Profile:
    # do not apply template
    save_without_callbacks: true

# before save, find records using the old id and put them on the specified association
renews:
  Article:
    parent_id: 
      association: parent
      base_type: Article
#  Profile:
#    home_page_id: 
#      association: home_page
#      base_type: Article
  Product:
    product_category_id:
      association: product_category
      base_type: Category
    image_id:
      association: image
      base_type: Image
  ProductQualifier:
    product_id:
      association: product
      base_type: Product
    qualifier_id:
      association: product
      base_type: Product
    certifier_id:
      association: qualifier
      base_type: Certifier