File tree Expand file tree Collapse file tree 1 file changed +29
-2
lines changed Expand file tree Collapse file tree 1 file changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,9 @@ return [
33
33
];
34
34
```
35
35
36
- You have to add a table to the database. Example schema for MySQL:
36
+ You have to add a table to the database. Example schema for:
37
+
38
+ MySQL:
37
39
38
40
``` SQL
39
41
CREATE TABLE `queue ` (
@@ -53,8 +55,33 @@ CREATE TABLE `queue` (
53
55
KEY ` priority` (` priority` )
54
56
) ENGINE= InnoDB
55
57
```
58
+ and Postgresql
59
+
60
+ ``` SQL
61
+ -- Necessary for creating Autoincrement field
62
+ CREATE SEQUENCE queue_seq ;
63
+
64
+ CREATE TABLE queue (
65
+ id bigint NOT NULL DEFAULT NEXTVAL (' queue_seq' ),
66
+ channel varchar (255 ) NOT NULL ,
67
+ job bytea NOT NULL ,
68
+ pushed_at bigint NOT NULL ,
69
+ ttr bigint NOT NULL ,
70
+ delay bigint NOT NULL DEFAULT 0 ,
71
+ priority bigint check (priority > 0 ) NOT NULL DEFAULT 1024 ,
72
+ reserved_at bigint ,
73
+ attempt bigint ,
74
+ done_at bigint ,
75
+ PRIMARY KEY (id)
76
+ );
77
+ -- Optional but good for speeding up queries
78
+ CREATE INDEX channel ON queue (channel);
79
+ CREATE INDEX reserved_at ON queue (reserved_at);
80
+ CREATE INDEX priority ON queue (priority);
81
+ ```
82
+
56
83
57
- Migrations are available from [ src/drivers/db/migrations] ( ../../src/drivers/db/migrations ) .
84
+ You can use migrations which are available from [ src/drivers/db/migrations] ( ../../src/drivers/db/migrations ) .
58
85
59
86
To add migrations to your application, edit the console config file to configure
60
87
[ a namespaced migration] ( http://www.yiiframework.com/doc-2.0/guide-db-migrations.html#namespaced-migrations ) :
You can’t perform that action at this time.
0 commit comments