mirror of
				https://github.com/openresty/openresty.git
				synced 2024-10-13 00:29:41 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			26 lines
		
	
	
		
			592 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			592 B
		
	
	
	
		
			C
		
	
	
	
	
	
| -- Blog posts
 | |
| drop table if exists posts;
 | |
| create table posts (
 | |
|     id serial,
 | |
|     title text not null,
 | |
|     content text not null,
 | |
|     author varchar(64) not null,
 | |
|     created timestamp(0) default now() not null,
 | |
|     comments integer default 0 not  null,
 | |
|     primary key (id)
 | |
| );
 | |
| 
 | |
| -- Blog comments
 | |
| drop table if exists comments;
 | |
| create table comments (
 | |
|     id serial,
 | |
|     sender varchar(64) not null,
 | |
|     email varchar(64),
 | |
|     url varchar(1024),
 | |
|     body text not null,
 | |
|     created timestamp(0) default now() not null,
 | |
|     post bigint not null,
 | |
|     foreign key (post) references posts(id)
 | |
| );
 | |
| 
 |