From 7b04476683ea2bd87aec73b26effb828f68c003e Mon Sep 17 00:00:00 2001 From: xjzh123 <37945610+xjzh123@users.noreply.github.com> Date: Sat, 30 Dec 2023 01:00:37 +0800 Subject: [PATCH] orm: fix the old attribute syntax in the README's example, to the new `@[attr]` form (#20305) --- vlib/orm/README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/vlib/orm/README.md b/vlib/orm/README.md index 808bd407c8..bb70672e55 100644 --- a/vlib/orm/README.md +++ b/vlib/orm/README.md @@ -32,16 +32,16 @@ import time @[table: 'foos'] struct Foo { - id int [primary; sql: serial] + id int @[primary; sql: serial] name string - created_at time.Time [default: 'CURRENT_TIME] - updated_at ?string [sql_type: 'TIMESTAMP] + created_at time.Time @[default: 'CURRENT_TIME'] + updated_at ?string @[sql_type: 'TIMESTAMP'] deleted_at ?time.Time - children []Child [fkey: 'parent_id'] + children []Child @[fkey: 'parent_id'] } struct Child { - id int [primary; sql: serial] + id int @[primary; sql: serial] parent_id int name string } @@ -131,9 +131,9 @@ result := sql db { import db.pg struct Member { - id string [default: 'gen_random_uuid()'; primary; sql_type: 'uuid'] + id string @[default: 'gen_random_uuid()'; primary; sql_type: 'uuid'] name string - created_at string [default: 'CURRENT_TIMESTAMP'; sql_type: 'TIMESTAMP'] + created_at string @[default: 'CURRENT_TIMESTAMP'; sql_type: 'TIMESTAMP'] } fn main() {