mirror of
				https://github.com/launchbadge/sqlx.git
				synced 2025-11-03 23:12:47 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			20 lines
		
	
	
		
			571 B
		
	
	
	
		
			SQL
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			571 B
		
	
	
	
		
			SQL
		
	
	
	
	
	
-- https://www.postgresql.org/docs/current/sql-createtype.html
 | 
						|
CREATE TYPE status AS ENUM ('new', 'open', 'closed');
 | 
						|
 | 
						|
-- https://www.postgresql.org/docs/current/rowtypes.html#ROWTYPES-DECLARING
 | 
						|
CREATE TYPE inventory_item AS
 | 
						|
(
 | 
						|
    name        TEXT,
 | 
						|
    supplier_id INT,
 | 
						|
    price       BIGINT
 | 
						|
);
 | 
						|
 | 
						|
-- https://github.com/prisma/database-schema-examples/tree/master/postgres/basic-twitter#basic-twitter
 | 
						|
CREATE TABLE tweet
 | 
						|
(
 | 
						|
    id         BIGSERIAL PRIMARY KEY,
 | 
						|
    created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
 | 
						|
    text       TEXT        NOT NULL,
 | 
						|
    owner_id   BIGINT
 | 
						|
);
 |