Add personal, Thai address, and emergency contact columns to employees

14 new nullable columns on the employees table:

Personal:
- dateOfBirth, gender, nationality, maritalStatus

Address (Thai-specific):
- addressLine1, addressLine2, subdistrict (Tambon),
  district (Amphoe), province (Changwat), postalCode, country

Emergency contact:
- emergencyContactName, emergencyContactPhone,
  emergencyContactRelationship

All nullable to leave existing rows intact. Constrained sets
(gender, marital status) live in the UI selects rather than
pgEnums for flexibility. Form/UI/export updates follow.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-15 09:56:48 +07:00
parent 1754b99909
commit ed98aefecd
+17
View File
@@ -215,6 +215,23 @@ export const employees = pgTable('employees', {
taxId: text('tax_id'),
bankName: text('bank_name'),
bankAccount: text('bank_account'),
// Personal
dateOfBirth: date('date_of_birth'),
gender: text('gender'),
nationality: text('nationality'),
maritalStatus: text('marital_status'),
// Address (Thai-specific)
addressLine1: text('address_line_1'),
addressLine2: text('address_line_2'),
subdistrict: text('subdistrict'),
district: text('district'),
province: text('province'),
postalCode: text('postal_code'),
country: text('country'),
// Emergency contact
emergencyContactName: text('emergency_contact_name'),
emergencyContactPhone: text('emergency_contact_phone'),
emergencyContactRelationship: text('emergency_contact_relationship'),
isActive: boolean('is_active').notNull().default(true),
deletedAt: timestamp('deleted_at', { withTimezone: true }),
createdAt: timestamp('created_at', { withTimezone: true }).notNull().defaultNow(),