|
4 | 4 |
|
5 | 5 | package migrations
|
6 | 6 |
|
7 |
| -<<<<<<< HEAD |
8 | 7 | import (
|
9 |
| - "code.gitea.io/gitea/modules/timeutil" |
10 | 8 | "github.com/go-xorm/xorm"
|
11 | 9 | )
|
12 | 10 |
|
13 |
| -func addProjectsTable(x *xorm.Engine) error { |
14 |
| - |
15 |
| - type ProjectType uint8 |
16 |
| - |
17 |
| - sess := x.NewSession() |
18 |
| - defer sess.Close() |
19 |
| - |
20 |
| - if err := sess.Begin(); err != nil { |
21 |
| - return err |
22 |
| - } |
23 |
| - |
24 |
| - type Project struct { |
25 |
| - ID int64 `xorm:"pk autoincr"` |
26 |
| - Title string `xorm:"INDEX NOT NULL"` |
27 |
| - Description string `xorm:"TEXT"` |
28 |
| - RepoID int64 `xorm:"NOT NULL"` |
29 |
| - CreatorID int64 `xorm:"NOT NULL"` |
30 |
| - IsClosed bool `xorm:"INDEX"` |
31 |
| - NumIssues int |
32 |
| - NumClosedIssues int |
33 |
| - |
34 |
| - Type ProjectType |
35 |
| - |
36 |
| - ClosedDateUnix timeutil.TimeStamp |
37 |
| - CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` |
38 |
| - UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"` |
39 |
| - } |
40 |
| - |
41 |
| - type Issue struct { |
42 |
| - ProjectID int64 `xorm:"INDEX"` |
43 |
| - } |
44 |
| - |
45 |
| - type ProjectBoard struct { |
46 |
| - ID int64 `xorm:"pk autoincr"` |
47 |
| - ProjectID int64 `xorm:"INDEX NOT NULL"` |
48 |
| - Title string |
49 |
| - |
50 |
| - // Not really needed but helpful |
51 |
| - CreatorID int64 `xorm:"NOT NULL"` |
52 |
| - |
53 |
| - CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` |
54 |
| - UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"` |
55 |
| - } |
56 |
| - |
57 |
| - if err := x.Sync(new(Project)); err != nil { |
58 |
| - return err |
59 |
| - } |
60 |
| - |
61 |
| - if err := x.Sync(new(ProjectBoard)); err != nil { |
62 |
| - return err |
63 |
| - } |
64 |
| - |
65 |
| - if err := x.Sync2(new(Issue)); err != nil { |
66 |
| - return err |
67 |
| - } |
68 |
| - |
69 |
| - return sess.Commit() |
70 |
| -======= |
71 |
| -import "github.com/go-xorm/xorm" |
72 |
| - |
73 | 11 | func addEmailNotificationEnabledToUser(x *xorm.Engine) error {
|
74 | 12 | // User see models/user.go
|
75 | 13 | type User struct {
|
76 | 14 | EmailNotificationsPreference string `xorm:"VARCHAR(20) NOT NULL DEFAULT 'enabled'"`
|
77 | 15 | }
|
78 | 16 |
|
79 | 17 | return x.Sync2(new(User))
|
80 |
| ->>>>>>> origin |
81 | 18 | }
|
0 commit comments