スキル一覧に戻る
TrueNine

database-standard

by TrueNine

1🍴 1📅 2025年12月3日
GitHubで見るManusで実行

SKILL.md


name: database-standard description: Database design standards defining primary keys, foreign keys, audit fields, soft delete, junction tables. PostgreSQL style preferred, SQL lowercase without comments.

Database Preferences

  • Forbidden: MySQL
  • Recommended: PostgreSQL or other modern databases
  • Required: Foreign key constraints for data integrity

SQL Code Style

  • All lowercase
  • SQL files have no comments

Primary Key Standard

FieldTypeDescription
idbigintPrimary key, required for all regular tables

Audit Fields

All tables except junction tables MUST include:

FieldFull NameTypeDefaultDescription
crdcreate row datetimetimestampcurrent_timestampRow creation time, timezone-independent
mrdmodify row datetimetimestampnullLast modification time, timezone-independent, nullable
rlvrow lock versioninteger0Optimistic lock version

Soft Delete Field

FieldFull NameTypeDefaultDescription
ldflogic delete fieldtimestampnullSoft delete time, timezone-independent, null means active

Junction Table Standard

Tables linking two entities:

  • No primary key
  • No audit fields
  • Only foreign key IDs from both tables

Tree Structure

Tables with upward lookup (e.g., address) use pid for parent link:

FieldTypeDescription
pidbigintParent primary key, nullable

Examples

Regular Table

create table user (
    id bigint primary key,
    name varchar(255) not null,
    email varchar(255),
    ldf timestamp,
    crd timestamp not null default current_timestamp,
    mrd timestamp,
    rlv integer not null default 0
);

Junction Table

create table user_role (
    user_id bigint not null references user(id),
    role_id bigint not null references role(id)
);

Tree Table

create table address (
    id bigint primary key,
    pid bigint references address(id),
    name varchar(255) not null,
    crd timestamp not null default current_timestamp,
    mrd timestamp,
    rlv integer not null default 0
);

スコア

総合スコア

60/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です