Advertisement
AntonHuretskyi

Тема3.Урок5.Задание4

Nov 18th, 2022
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ALTER TABLE cdm.dm_settlement_report ALTER COLUMN orders_count SET DEFAULT 0;
  2.  
  3. ALTER TABLE cdm.dm_settlement_report
  4. ADD CONSTRAINT dm_settlement_report_orders_count_check
  5. CHECK ((orders_count)::numeric >= (0)::numeric);
  6.  
  7. ALTER TABLE cdm.dm_settlement_report ALTER COLUMN orders_total_sum SET DEFAULT 0;
  8.  
  9. ALTER TABLE cdm.dm_settlement_report
  10. ADD CONSTRAINT dm_settlement_report_orders_total_sum_check
  11. CHECK (orders_total_sum >= (0)::numeric);
  12.  
  13. ALTER TABLE cdm.dm_settlement_report ALTER COLUMN orders_bonus_payment_sum SET DEFAULT 0;
  14.  
  15. ALTER TABLE cdm.dm_settlement_report
  16. ADD CONSTRAINT dm_settlement_report_orders_bonus_payment_sum_check
  17. CHECK (orders_bonus_payment_sum >= (0)::numeric);
  18.  
  19. ALTER TABLE cdm.dm_settlement_report ALTER COLUMN orders_bonus_granted_sum SET DEFAULT 0;
  20.  
  21. ALTER TABLE cdm.dm_settlement_report
  22. ADD CONSTRAINT dm_settlement_report_orders_bonus_granted_sum_check
  23. CHECK (orders_bonus_granted_sum >= (0)::numeric);
  24.  
  25. ALTER TABLE cdm.dm_settlement_report ALTER COLUMN order_processing_fee SET DEFAULT 0;
  26.  
  27. ALTER TABLE cdm.dm_settlement_report
  28. ADD CONSTRAINT dm_settlement_report_order_processing_fee_check
  29. CHECK (order_processing_fee >= (0)::numeric);
  30.  
  31. ALTER TABLE cdm.dm_settlement_report ALTER COLUMN restaurant_reward_sum SET DEFAULT 0;
  32.  
  33. ALTER TABLE cdm.dm_settlement_report
  34. ADD CONSTRAINT dm_settlement_report_restaurant_reward_sum_check
  35. CHECK (restaurant_reward_sum >= (0)::numeric);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement