Skip to content

Commit b2b7cb0

Browse files
committed
Add new migration
Change CronExpression type from varchar (25) to varchar (255)
1 parent e619b26 commit b2b7cb0

4 files changed

Lines changed: 25 additions & 1 deletion

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,5 @@ Thumbs.db
4141
/Publish
4242
/Scripts/migrate.log
4343
/Scripts/restore.log
44+
/restore.log
45+
/.vs/SimpleToDoService/xs/UserPrefs.xml

RequestTests.paw

303 Bytes
Binary file not shown.

Scripts/Migrations/3.sql

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
DO
2+
$$
3+
BEGIN
4+
raise notice 'Migration from 3 to 4';
5+
if (select version from dbversion limit 1) = 3 then
6+
7+
raise notice 'Started';
8+
9+
ALTER TABLE TaskPrototype ALTER COLUMN CronExpression TYPE varchar (255)
10+
11+
raise notice 'Altered TaskPrototype';
12+
raise notice 'Change CronExpression TYPE to varchar (255)';
13+
14+
update dbversion
15+
set version = 4
16+
where version = 3;
17+
18+
end if;
19+
20+
raise notice 'Complete';
21+
END
22+
$$

src/SimpleToDoService/Database/Entities.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public class TaskPrototype
5959
public Guid Uuid { get; set; }
6060

6161
[Column("cronexpression")]
62-
[MaxLength(25)]
62+
[MaxLength(255)]
6363
public string CronExpression { get; set; }
6464

6565
[XmlIgnore]

0 commit comments

Comments
 (0)