Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 493419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T02:12:47+00:00 2026-05-13T02:12:47+00:00

I have the following schema.yml file: Page: actAs: I18n: fields: [name,html,urlShortDesc] columns: name: string

  • 0

I have the following schema.yml file:

Page:
  actAs:
    I18n:
      fields: [name,html,urlShortDesc]
  columns:
    name: string
    gender: 
      type: enum
      values: [html, photoGallery]
      default: html
    html: string
    urlShortDesc: string
    section_id: 
      type: integer
      notnull: true
  relations:
    Section: 
      foreignAlias: Pages
    SubPage:
      class: Page
      local: subpage
      foreign: id
      type: one

But, when I execute the build-all-reload command, the following error message is displayed:

SQLSTATE[42000]: Syntax error or access violation: 1072 Key column ‘subpage’ doesn’t exist in table

I’m trying to implement a self-relation class.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T02:12:48+00:00Added an answer on May 13, 2026 at 2:12 am

    I think you want to have what you have listed:

    SubPage:
      class: Page
      local: subpage
      foreign: id
      type: one
    

    but you need an id column (foreign: id) for the primary key of the Page table and a column called ‘subpage’ which contains the reference (local: subpage) to the child. So you may have Page with id = “100” containing a field called subpage which contains an id = “200” and that “200” is the actual key (id) of a different page.

    UPDATE: From comment to modify original schema file:

    Page:
      actAs:
        I18n:
          fields: [name,html,urlShortDesc]
      columns:
        name: string
        gender: 
          type: enum
          values: [html, photoGallery]
          default: html
        html: string
        urlShortDesc: string
        section_id: 
          type: integer
          notnull: true
        id: 
          type: integer
          notnull: true
        subpage: 
          type: integer
          notnull: false
      relations:
        Section: 
          foreignAlias: Pages
        SubPage:
          class: Page
          local: subpage
          foreign: id
          type: one
    

    Please note that I am making some serious assumptions on your schema including:

    • you want id as your primary key and that you will take care of it being set (you may want autoincrement: true in the schema).
    • subpage is optional as a child relation
    • section_id is not your primary key
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following schema.yml Proposition: actAs: { Timestampable: ~ } columns: name: {
I have the following schema User: columns: id: type: integer primary: true name: string
I have the following schema.yml: JosJeventsVevdetail: connection: doctrine tableName: jos_jevents_vevdetail columns: evdet_id: type: integer(4)
I have the following JSON schema { employee: {display_name:EMPLOYEE NAME:, format:string, type:textbox, dflt:null, isMandatory:true}
Say you have the following in a schema: <xsd:complexType name=shape/> <xsd:complexType name=circle> <xsd:complexContent> <xsd:extension
I have the following: <xs:schema> <xs:complexType name=NameType> <xs:sequence> <xs:element name=NamePrefix type=core:NamePrefixType minOccurs=0/> <xs:element name=FirstName
I have run across an XML Schema with the following definition: <xs:simpleType name=ClassRankType> <xs:restriction
I have the following schema definition: Usuario: columns: empresa_id: { type: BIGINT, notnull: true
I have the following: Schema create_table mouldings, :force => true do |t| t.string suppliers_code
I have the following schema: product - productID (PK) - name - units purchase

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.