Files
njts-accounting-core/backend/sql/add_my_number_field.sql
2026-01-21 10:58:19 +09:00

13 lines
452 B
SQL
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- マイナンバーカード番号フィールドを追加
-- Add my_number field to employees table
ALTER TABLE employees
ADD COLUMN IF NOT EXISTS my_number VARCHAR(12);
COMMENT ON COLUMN employees.my_number IS 'マイナンバー個人番号12桁';
-- マイナンバーは機密情報なので、ユニーク制約を追加
CREATE UNIQUE INDEX IF NOT EXISTS idx_employees_my_number
ON employees(my_number)
WHERE my_number IS NOT NULL;