diff --git a/.xata/migrations/.ledger b/.xata/migrations/.ledger index 51f0c4c..62118f3 100644 --- a/.xata/migrations/.ledger +++ b/.xata/migrations/.ledger @@ -1,3 +1,5 @@ mig_cq7pvfejdq8qdocak5eg mig_cq7pvjejdq8qdocak5g0 mig_cq7pvlujdq8qdocak5h0 +mig_cq7q7hmjdq8qdocak5u0 +mig_cq7qmk3o9aogmh95uc1g diff --git a/.xata/migrations/mig_cq7q7hmjdq8qdocak5u0.json b/.xata/migrations/mig_cq7q7hmjdq8qdocak5u0.json new file mode 100644 index 0000000..02492b3 --- /dev/null +++ b/.xata/migrations/mig_cq7q7hmjdq8qdocak5u0.json @@ -0,0 +1,30 @@ +{ + "done": true, + "migration": { + "name": "mig_cq7q7hmjdq8qdocak5u0", + "operations": [ + { + "add_column": { + "table": "Posts", + "column": { + "pk": false, + "name": "title", + "type": "text", + "check": { + "name": "Posts_xata_string_length_title", + "constraint": "LENGTH(\"title\") <= 2048" + }, + "unique": false, + "comment": "{\"xata.type\":\"string\"}", + "nullable": true + } + } + } + ] + }, + "migrationType": "pgroll", + "name": "mig_cq7q7hmjdq8qdocak5u0", + "parent": "mig_cq7pvlujdq8qdocak5h0", + "schema": "public", + "startedAt": "2024-07-11T09:51:52.844933Z" +} diff --git a/.xata/migrations/mig_cq7qmk3o9aogmh95uc1g.json b/.xata/migrations/mig_cq7qmk3o9aogmh95uc1g.json new file mode 100644 index 0000000..aff679c --- /dev/null +++ b/.xata/migrations/mig_cq7qmk3o9aogmh95uc1g.json @@ -0,0 +1,30 @@ +{ + "done": true, + "migration": { + "name": "mig_cq7qmk3o9aogmh95uc1g", + "operations": [ + { + "add_column": { + "table": "Posts", + "column": { + "pk": false, + "name": "description", + "type": "text", + "check": { + "name": "Posts_xata_string_length_description", + "constraint": "LENGTH(\"description\") <= 2048" + }, + "unique": false, + "comment": "{\"xata.type\":\"string\"}", + "nullable": true + } + } + } + ] + }, + "migrationType": "pgroll", + "name": "mig_cq7qmk3o9aogmh95uc1g", + "parent": "mig_cq7q7hmjdq8qdocak5u0", + "schema": "public", + "startedAt": "2024-07-11T09:52:16.888674Z" +} diff --git a/src/app/page.tsx b/src/app/page.tsx index 29defe9..a76a3be 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -32,9 +32,6 @@ export default async function Home({ {posts.length === 0 &&

No blog posts found

} {posts.map((post) => (
-

- {post.pubDate?.toDateString()} -

{post.title}

diff --git a/src/app/posts/[slug]/page.tsx b/src/app/posts/[slug]/page.tsx index 61c1fb5..8f83349 100644 --- a/src/app/posts/[slug]/page.tsx +++ b/src/app/posts/[slug]/page.tsx @@ -12,10 +12,7 @@ export default async function Post({ params }: { params: { slug: string } }) { ← Back to blog

-

{post?.title}

-

- {post?.pubDate?.toDateString()} -

+

{post?.title}

{post?.description}

); diff --git a/src/xata.ts b/src/xata.ts index fd9133f..3dfcf45 100644 --- a/src/xata.ts +++ b/src/xata.ts @@ -10,6 +10,13 @@ const tables = [ { name: "Posts", columns: [ + { + name: "description", + type: "text", + notNull: false, + unique: false, + defaultValue: null, + }, { name: "slug", type: "text", @@ -17,6 +24,13 @@ const tables = [ unique: false, defaultValue: null, }, + { + name: "title", + type: "text", + notNull: false, + unique: false, + defaultValue: null, + }, { name: "xata_createdat", type: "datetime",