修正
This commit is contained in:
24
backend/sql/add_line_description.sql
Normal file
24
backend/sql/add_line_description.sql
Normal file
@@ -0,0 +1,24 @@
|
||||
-- ============================================================================
|
||||
-- マイグレーション: journal_lines テーブルに line_description カラム追加
|
||||
-- 実行方法: admin または postgres 超级用户で実行
|
||||
-- psql -h 192.168.0.61 -p 55432 -U admin -d njts_acct -f add_line_description.sql
|
||||
-- ============================================================================
|
||||
|
||||
DO $$
|
||||
BEGIN
|
||||
IF NOT EXISTS (
|
||||
SELECT 1 FROM information_schema.columns
|
||||
WHERE table_name = 'journal_lines' AND column_name = 'line_description'
|
||||
) THEN
|
||||
ALTER TABLE journal_lines ADD COLUMN line_description TEXT;
|
||||
RAISE NOTICE '✓ line_description カラムを journal_lines に追加しました';
|
||||
ELSE
|
||||
RAISE NOTICE '✓ line_description カラムはすでに存在しています';
|
||||
END IF;
|
||||
END $$;
|
||||
|
||||
-- 確認
|
||||
SELECT column_name, data_type, is_nullable
|
||||
FROM information_schema.columns
|
||||
WHERE table_name = 'journal_lines'
|
||||
ORDER BY ordinal_position;
|
||||
Reference in New Issue
Block a user