File tree 1 file changed +59
-59
lines changed
1 file changed +59
-59
lines changed Original file line number Diff line number Diff line change @@ -69,66 +69,21 @@ type Post struct {
69
69
}
70
70
```
71
71
72
- ### goose
73
-
74
- ``` sql
75
- -- +goose Up
76
- CREATE TABLE post (
77
- id int NOT NULL ,
78
- title text ,
79
- body text ,
80
- PRIMARY KEY (id)
81
- );
82
-
83
- -- +goose Down
84
- DROP TABLE post;
85
- ```
86
-
87
- ``` go
88
- package db
89
-
90
- type Post struct {
91
- ID int
92
- Title sql.NullString
93
- Body sql.NullString
94
- }
95
- ```
96
-
97
- ### sql-migrate
72
+ ### dbmate
98
73
99
74
``` sql
100
- -- +migrate Up
101
- -- SQL in section 'Up' is executed when this migration is applied
102
- CREATE TABLE people (id int );
103
-
104
-
105
- -- +migrate Down
106
- -- SQL section 'Down' is executed when this migration is rolled back
107
- DROP TABLE people;
108
- ```
109
-
110
- ``` go
111
- package db
112
-
113
- type People struct {
114
- ID int32
115
- }
116
- ```
117
-
118
- ### tern
75
+ -- migrate:up
76
+ CREATE TABLE foo (bar INT NOT NULL );
119
77
120
- ``` sql
121
- CREATE TABLE comment (id int NOT NULL , text text NOT NULL );
122
- -- -- create above / drop below ----
123
- DROP TABLE comment;
78
+ -- migrate:down
79
+ DROP TABLE foo;
124
80
```
125
81
126
82
``` go
127
83
package db
128
84
129
- type Comment struct {
130
- ID int32
131
- Text string
85
+ type Foo struct {
86
+ Bar int32
132
87
}
133
88
```
134
89
@@ -188,20 +143,65 @@ type Post struct {
188
143
}
189
144
```
190
145
191
- ### dbmate
146
+ ### goose
192
147
193
148
``` sql
194
- -- migrate:up
195
- CREATE TABLE foo (bar INT NOT NULL );
149
+ -- +goose Up
150
+ CREATE TABLE post (
151
+ id int NOT NULL ,
152
+ title text ,
153
+ body text ,
154
+ PRIMARY KEY (id)
155
+ );
196
156
197
- -- migrate:down
198
- DROP TABLE foo ;
157
+ -- +goose Down
158
+ DROP TABLE post ;
199
159
```
200
160
201
161
``` go
202
162
package db
203
163
204
- type Foo struct {
205
- Bar int32
164
+ type Post struct {
165
+ ID int
166
+ Title sql.NullString
167
+ Body sql.NullString
168
+ }
169
+ ```
170
+
171
+ ### sql-migrate
172
+
173
+ ``` sql
174
+ -- +migrate Up
175
+ -- SQL in section 'Up' is executed when this migration is applied
176
+ CREATE TABLE people (id int );
177
+
178
+
179
+ -- +migrate Down
180
+ -- SQL section 'Down' is executed when this migration is rolled back
181
+ DROP TABLE people;
182
+ ```
183
+
184
+ ``` go
185
+ package db
186
+
187
+ type People struct {
188
+ ID int32
189
+ }
190
+ ```
191
+
192
+ ### tern
193
+
194
+ ``` sql
195
+ CREATE TABLE comment (id int NOT NULL , text text NOT NULL );
196
+ -- -- create above / drop below ----
197
+ DROP TABLE comment;
198
+ ```
199
+
200
+ ``` go
201
+ package db
202
+
203
+ type Comment struct {
204
+ ID int32
205
+ Text string
206
206
}
207
207
```
You can’t perform that action at this time.
0 commit comments