statamic-rad-pack / runway

Eloquently manage your database models in Statamic.
https://statamic.com/runway
MIT License
107 stars 43 forks source link

Upgrade created empty blueprints #431

Closed edalzell closed 4 months ago

edalzell commented 4 months ago

Description

Upgraded a site from v5 to v6 and the correct blueprints were created, but they were empty.

Steps to reproduce

  1. have v5 sites with several blueprints
  2. follow migration instructions
  3. see empty blueprints

CleanShot 2024-02-15 at 16 13 51@2x

Actual Orphan blueprint:

title: Orphan
tabs:
  main:
    display: Personal
    sections:
      -
        fields:
          -
            handle: first_name
            field:
              input_type: text
              antlers: false
              display: 'First Name'
              type: text
              icon: text
              width: 25
              validate:
                - required
              localizable: false
          -
            handle: last_name
            field:
              input_type: text
              antlers: false
              display: 'Last Name'
              type: text
              icon: text
              width: 25
              localizable: false
          -
            handle: orphan_id
            field:
              input_type: text
              antlers: false
              display: ID
              type: text
              icon: text
              width: 25
              instructions: 'Leave blank to auto-generate id'
              instructions_position: below
              localizable: false
          -
            handle: published
            field:
              default: true
              display: Published
              type: toggle
              icon: toggle
              listable: hidden
              instructions_position: above
              width: 25
              localizable: false
              always_save: true
              if: 'custom has:view all orphan fields'
          -
            handle: country_id
            field:
              max_items: 1
              mode: select
              resource: country
              display: Country
              type: belongs_to
              icon: belongs_to
              width: 50
              validate:
                - required
              localizable: false
          -
            handle: field_representative_id
            field:
              max_items: 1
              mode: select
              display: 'Field Rep'
              type: field_representatives
              icon: users
              width: 50
              localizable: false
              always_save: true
              if: 'custom has:view all orphan fields'
          -
            handle: gender
            field:
              options:
                Male: Male
                Female: Female
                Other: Other
              multiple: false
              clearable: false
              searchable: true
              taggable: false
              push_tags: false
              cast_booleans: false
              display: Gender
              type: select
              icon: select
              width: 50
              localizable: false
          -
            handle:  profile->birth_city
            field:
              input_type: text
              antlers: false
              display: Birth City
              type: text
              icon: text
              width: 50
              instructions_position: below
              localizable: false
          -
            handle: birthdate
            field:
              mode: single
              time_enabled: false
              time_required: false
              earliest_date: '1900-01-01'
              full_width: false
              inline: false
              columns: 1
              rows: 1
              display: Birthdate
              type: date
              icon: date
              width: 50
              validate:
                - required
              localizable: false
          -
            handle: created_at
            field:
              mode: single
              time_enabled: false
              time_required: false
              earliest_date: '2000-01-01'
              full_width: false
              inline: false
              columns: 1
              rows: 1
              display: 'Enrolled On'
              type: date
              icon: date
              listable: hidden
              width: 50
              localizable: false
          -
            handle: profile->birth_certificate
            field:
              mode: grid
              container: private
              folder: sponsor-an-orphan/birth-certificates
              restrict: false
              allow_uploads: true
              max_files: 1
              display: Birth Certificate
              type: assets
              icon: assets
              listable: hidden
              localizable: false
              width: 50
              validate:
                - required
          -
            handle: images
            field:
              mode: grid
              container: private
              folder: sponsor-an-orphan/portraits
              restrict: false
              allow_uploads: true
              display: Photos
              type: assets
              icon: assets
              listable: hidden
              localizable: false
              width: 50
              instructions: 'The first image will be used for the orphans profile image. All subsequent images will be available for the sponsor to swipe through in a carousel slider'
          -
            handle: story
            field:
              type: bard
              buttons:
                - bold
                - italic
                - underline
                - anchor
              style: sans
              spellcheck: true
              allow_source: true
              allow_internal_links: true
              link_noopener: false
              link_noreferrer: false
              target_blank: false
              semantic_elements: true
              width: 75
              listable: false
              localizable: false
              if: 'custom has:view all orphan fields'
          -
            handle: generate_story
            field:
              type: generate_story
              save: false
              width: 25
              visibility: computed
              hide_display: true
              if: 'custom has:view all orphan fields'
          -
            handle: created_by_fieldrep
            field:
              type: toggle
              visibility: hidden
              save: false
  family_status:
    display: 'Family Status'
    sections:
      -
        fields:
          -
            import: family_status
  education:
    display: Education
    sections:
      -
        fields:
          -
            import: education
  interview:
    display: Interview
    sections:
      -
        fields:
          -
            import: orphan_interview
  benefits:
    display: Benefits
    sections:
      -
        fields:
          -
            import: benefits
  internal:
    display: 'Internal'
    sections:
      -
        fields:
          -
            import: internal
  updates:
    display: Updates
    sections:
      -
        fields:
          -
            handle: updates
            field:
              mode: default
              resource: orphanupdate
              display: Updates
              type: has_many
              icon: has_many
              listable: hidden
              instructions_position: above
              localizable: false
              always_save: true
              if: 'custom has:view all orphan fields'
  sponsorship:
    display: Sponsorship
    sections:
      -
        fields:
          -
            import: sponsorship
  legacy:
    display: 'Legacy'
    sections:
      -
        fields:
          -
            import: legacy

Environment

Environment Application Name: Zakat Foundation of America Laravel Version: 10.44.0 PHP Version: 8.3.2 Composer Version: 2.5.5 Environment: local Debug Mode: ENABLED URL: zakat.test Maintenance Mode: OFF

Cache Config: NOT CACHED Events: NOT CACHED Routes: NOT CACHED Views: NOT CACHED

Drivers Broadcasting: log Cache: statamic Database: mysql Logs: daily Mail: smtp Queue: sync Session: file

Statamic Addons: 11 Antlers: runtime Sites: 3 (zakat.org (EN), zakat.org (AR), zfinstitute.com (ZFI)) Stache Watcher: Disabled Static Caching: Disabled Version: 4.48.0 PRO

Statamic Addons aryehraber/statamic-captcha: 1.10.0 edalzell/forma: 2.1 jonassiewertsen/statamic-livewire: 2.12.0 statamic-rad-pack/runway: 6.1.0 statamic/seo-pro: 5.4.1 transformstudios/events: 5.3.0 transformstudios/front: 2.0.4 transformstudios/github: dev-main transformstudios/neon: dev-fix/upgrade-runway transformstudios/review: 4.1.4 transformstudios/simple: 4.20.1

edalzell commented 4 months ago

Removing the empty ones and running php please runway:migrate-blueprints worked though

edalzell commented 4 months ago

But it did MOVE them and not copy them.

duncanmcclean commented 4 months ago

Ah, it's probably not happening during the upgrade due to the namespace change. I'll add that command as a step to the upgrade guide.