joaofabioma

uuid v7

Aug 24th, 2026
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PostgreSQL 0.54 KB | Source Code | 0 0
  1. DROP TABLE IF EXISTS waha_outbound_queue;
  2. DROP TABLE IF EXISTS modelo_model_migration;
  3. CREATE TABLE IF NOT EXISTS public.modelo_model_migration (
  4.   id BIGSERIAL PRIMARY KEY,
  5.   id_uuid uuid NOT NULL DEFAULT uuidv7(),
  6.   created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
  7.   updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
  8. );
  9.  
  10.  
  11. INSERT INTO modelo_model_migration DEFAULT VALUES;
  12.  
  13. SELECT * FROM modelo_model_migration;
  14.  
  15. SELECT uuid_extract_timestamp (id_uuid), uuid_extract_version(id_uuid),  created_at, updated_at  FROM modelo_model_migration
  16.  
  17.  
  18.  
Advertisement
Add Comment
Please, Sign In to add comment