Liquibase 및 MySql - UUID에서 자동으로 ID를 생성하는 방법
P粉633733146
P粉633733146 2024-03-27 00:01:32
0
1
457

liquibase용 스크립트를 만들고 싶습니다. 다음 스크립트에 삽입할 때 UUID를 통해 자동으로 ID를 생성하고 싶습니다. 나는 거기에서 찾은 것을 시도했습니다. 편집: 나는 답변을 사용했습니다:

으아악

첫 번째 스크립트는 잘 작동하고 테이블이 생성되지만 두 번째 스크립트를 추가하면:

으아악

이제 오류는 다음과 같습니다.

<property name="u_id" value="uuid()" dbms="mysql"/>
<changeSet id="1" author="xyz">
    <createTable tableName="persons">
        <column name="id" type="varchar(36)" defaultValueComputed="${u_id}">
            <constraints primaryKey="true" nullable="false"/>
        </column>
        <column name="name" type="varchar(50)">
            <constraints nullable="false"/>
        </column>
        <column name="surname" type="varchar(50)">
            <constraints nullable="false"/>
        </column>
        <column name="email" type="varchar(50)">
            <constraints nullable="false" unique="true"/>
        </column>
    </createTable>
</changeSet>
</databaseChangeLog>

P粉633733146
P粉633733146

모든 응답(1)
P粉741678385

열 정의는 다음과 같아야 합니다: id 으아악

최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!