質問

次のデータベース構造があります。

Account:
    columns:
        email: string(255)
        name:
            type: string(255)

UserRegistered:
    columns:
        email:
            type: string(255)
            email: true
            notnull: true
            unique: true
        username:
            type: string(255)
            notnull: true
            nospace: true
            unique: true
            minlength: 5
        password:
            type: string(255)
        token: string(255)
    inheritance:
        extends: Account
        type: concrete

UserOpenid:
   columns:
       openid: string(255)
       openid_provider: string(255)
   inheritance:
       extends: Account
       type: concrete

新しいUserSefisteredまたはuseropenIDレコードを挿入すると、アカウントレコードと同様にユーザーが登録されたレコードを作成することが期待されていました。

私は相続を誤解しましたか /私はそれを誤用していますか、それとも何か間違ったことをしましたか?

役に立ちましたか?

解決

コンクリート継承を使用する場合、マスターテーブルは常に空になります。マスターテーブルのすべてのフィールドは、子テーブルで複製されています。したがって、マスターテーブルに書き込む必要はありません。

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top