File tree Expand file tree Collapse file tree 8 files changed +63
-90
lines changed
Expand file tree Collapse file tree 8 files changed +63
-90
lines changed Original file line number Diff line number Diff line change 11services :
22 postgres :
3- container_name : postgres
4- image : ghcr.io/fboulnois/pg_uuidv7:1.6.0
3+ container_name : postgres-18
4+ image : postgres:18-alpine
55 environment :
66 POSTGRES_USER : postgres
77 POSTGRES_PASSWORD : oF8yWaAkjBcEUAy1
88 POSTGRES_DB : ytweet
99 ports :
1010 - " 5432:5432"
1111 volumes :
12- - ./db/pg:/var/lib/postgresql/data
12+ - ./db/pg:/var/lib/postgresql
1313 redis :
1414 container_name : redis
1515 image : redis
Original file line number Diff line number Diff line change 11CREATE TABLE "ytweet_post " (
2- " id" uuid PRIMARY KEY DEFAULT uuid_generate_v7 () NOT NULL ,
2+ " id" uuid PRIMARY KEY DEFAULT uuidv7 () NOT NULL ,
33 " content" varchar (256 ) NOT NULL ,
44 " createdAt" timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL ,
55 " profilePicture" varchar (256 ),
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11{
2- "id" : " d2709e9c-974c-461e-b80f-ece9603e977a " ,
2+ "id" : " 7f238b79-2149-4582-9637-3ec54c3693d6 " ,
33 "prevId" : " 00000000-0000-0000-0000-000000000000" ,
44 "version" : " 7" ,
55 "dialect" : " postgresql" ,
6- "tables" : {},
6+ "tables" : {
7+ "public.ytweet_post" : {
8+ "name" : " ytweet_post" ,
9+ "schema" : " " ,
10+ "columns" : {
11+ "id" : {
12+ "name" : " id" ,
13+ "type" : " uuid" ,
14+ "primaryKey" : true ,
15+ "notNull" : true ,
16+ "default" : " uuidv7()"
17+ },
18+ "content" : {
19+ "name" : " content" ,
20+ "type" : " varchar(256)" ,
21+ "primaryKey" : false ,
22+ "notNull" : true
23+ },
24+ "createdAt" : {
25+ "name" : " createdAt" ,
26+ "type" : " timestamp with time zone" ,
27+ "primaryKey" : false ,
28+ "notNull" : true ,
29+ "default" : " CURRENT_TIMESTAMP"
30+ },
31+ "profilePicture" : {
32+ "name" : " profilePicture" ,
33+ "type" : " varchar(256)" ,
34+ "primaryKey" : false ,
35+ "notNull" : false
36+ },
37+ "authorName" : {
38+ "name" : " authorName" ,
39+ "type" : " varchar(256)" ,
40+ "primaryKey" : false ,
41+ "notNull" : true
42+ },
43+ "updatedAt" : {
44+ "name" : " updatedAt" ,
45+ "type" : " timestamp with time zone" ,
46+ "primaryKey" : false ,
47+ "notNull" : false
48+ }
49+ },
50+ "indexes" : {},
51+ "foreignKeys" : {},
52+ "compositePrimaryKeys" : {},
53+ "uniqueConstraints" : {},
54+ "policies" : {},
55+ "checkConstraints" : {},
56+ "isRLSEnabled" : false
57+ }
58+ },
759 "enums" : {},
860 "schemas" : {},
9- "views" : {},
1061 "sequences" : {},
1162 "roles" : {},
1263 "policies" : {},
64+ "views" : {},
1365 "_meta" : {
1466 "columns" : {},
1567 "schemas" : {},
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 55 {
66 "idx" : 0 ,
77 "version" : " 7" ,
8- "when" : 1754750249390 ,
9- "tag" : " 0000_uuidv7" ,
10- "breakpoints" : true
11- },
12- {
13- "idx" : 1 ,
14- "version" : " 7" ,
15- "when" : 1754858714388 ,
16- "tag" : " 0001_daily_absorbing_man" ,
8+ "when" : 1759936332184 ,
9+ "tag" : " 0000_supreme_earthquake" ,
1710 "breakpoints" : true
1811 }
1912 ]
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ export const createTable = pgTableCreator((name) => `ytweet_${name}`);
1515export const PostTable = createTable (
1616 "post" ,
1717 ( d ) => ( {
18- id : uuid ( ) . primaryKey ( ) . default ( sql `uuid_generate_v7 ()` ) ,
18+ id : uuid ( ) . primaryKey ( ) . default ( sql `uuidv7 ()` ) ,
1919 content : d . varchar ( { length : 256 } ) . notNull ( ) ,
2020 createdAt : d
2121 . timestamp ( { withTimezone : true } )
Original file line number Diff line number Diff line change 2121 "hyperdrive" : [
2222 {
2323 "binding" : " HYPERDRIVE" ,
24- "id" : " d898c6bc8c874f74adf621164131aa3f " ,
24+ "id" : " e799595947fe4889af932e5953e6d3b1 " ,
2525 // Optional. Can be used to connect to a local database for local development with `wrangler dev`
2626 "localConnectionString" : " postgresql://postgres:oF8yWaAkjBcEUAy1@localhost:5432/ytweet"
2727 }
You can’t perform that action at this time.
0 commit comments