lab5 - оценка 4
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
DELETE FROM attachment_variants
|
||||
WHERE kind = 'original' OR width < 1 OR height < 1 OR size_bytes < 1;
|
||||
|
||||
ALTER TABLE attachment_variants DROP CONSTRAINT IF EXISTS attachment_variants_kind_check;
|
||||
ALTER TABLE attachment_variants ADD CONSTRAINT attachment_variants_kind_check
|
||||
CHECK (kind IN ('thumbnail_256', 'crop_128', 'optimized_webp'));
|
||||
|
||||
ALTER TABLE attachment_variants DROP CONSTRAINT IF EXISTS attachment_variants_dims_check;
|
||||
ALTER TABLE attachment_variants ADD CONSTRAINT attachment_variants_dims_check
|
||||
CHECK (width >= 1 AND height >= 1 AND size_bytes >= 1);
|
||||
Reference in New Issue
Block a user