Missing table pubsub_state in ejabberd - postgresql

I have ejabberd working well but my logs are filling up with references to a missing table pubsub_state. I have a bunch of other tables with that prefix but not that one. Where can I find the definition so that I can add it?
I am using PostgreSQL as my back end.

The definition is in pg.sql but it's strange it wasn't created when you created the other tables...
https://github.com/processone/ejabberd/blob/master/sql/pg.sql#L243

Related

Creating a rule in postgresql to automatically add a json on INSERT

I'm creating a discord member db in PostgreSQL but I'm still a beginner.
And I'm trying, as specified in the title, to create a rule that, when I add a new member to the db, adds a json to that member's column.
Here's the code I got so far and it's not working:
CREATE OR REPLACE RULE tank_json AS
ON INSERT TO public.members
DO (UPDATE members
SET tank={"own_tank"=0, "engine"=0, "wheels"=0, "cannon"=0}
WHERE NEW.name);
I think that the problem might be on the last part "WHERE NEW.name" but I'm not sure how else I'm supposed to specify where it should add that json without messing with the other member's data.
Thanks in advance.

* coming in place of keys when connecting saiku with mongo using apache drill

I am using Apache drill in embedded mode and when I am able to connect to mongo and query in drill successfully.
However when I create a schema in saiku schema designer using driver as "org.apache.drill.jdbc.Driver" and URL as "jdbc:drill:drillbit=hostname:31010" the connection is successful and all collections are also fetched and shown as tables in saiku, but in place of column names "*" is coming and actual column names are not coming.
Dont know what I am missing on.
I figured out the solution and posting in case anyone could benefit. I had created a view in drill with select * from table. When I created view as select col1,col2... from table the issue got resolved.

Entity Framework not getting column info on a different schema

I am having trouble getting column information on a different schema.
It was working fine until we changed the connection string.
default schema is [dbo]
the newly adding stored procedure is in "different_schema"
Does anyone know and had the same experience on this issue?
Thank you in advance.
At the start of the stored proc temporarily add
SET FMTONLY OFF
to get the column information returned.
This is explained well here

How to apply new changes without dropping current data in the db.(Playframework evaluations)

I'm using play 2.2.1 with scala. And I have a managing database evaluations. When I run my application with changes on the database, it'll drop all my datas.
At this moment evaluationplugin = disabled is comment in. If I comment out, it does not apply my changes.
For example. I have a users table and there are id, f_name, l_name
User
id f_name l_name
1. khazo rasp
And I want to add age field to this table without losing data. I've added this field in scala files.It works properly. I'm assuming I need to write script in 1.sql for some alter command, but I don't want to write script.
How to apply new changes without dropping current data in the db. I've read this documentation. Thanks in advance.
I've added this field in scala files
In slick (you have the tag play-slick), you can specify a default value in your Table
See the documentation here, under Tables:
Default[T](defaultValue: T)
Specify a default value for inserting data the table without this column. This information is only used for creating DDL statements so that the database can fill in the missing information.
I am not sure if it gets translated to ALTER statement if the table already exists . You will have to test it.

JPA model update [1.1.1]

I'm sure this is something very simple, but for the life of me can't
find the correct keywords on google.
Basically I've updated a couple models since my last deployment. Dev is set up with the jpa.ddl default setting of create-drop. Now I read that prod isn't supposed to run with jpa.ddl=update, so does that mean I have to manually script a schema change? I couldn't find any documentation saying the correct way. I am also using playapps, so the database is set up there. I set up ssl, so I should have sql access via command line. However, I was having difficulty figuring out the syntax for modifying the db. I'm so used to a gui environment such as phpMySQL or microsoft's sql server. The errors specifically I'm getting are the following two (when running the application after uploading to prod).
Unsuccessful: alter table PhotoSlide add index FK57E3FABF5C905145 (aPhoto_id), add constraint FK57E3FABF5C905145 foreign key (aPhoto_id) references StorePhoto (id)
Cannot add or update a child row: a foreign key constraint fails (play/#sql-2e29_32, CONSTRAINT FK57E3FABF5C905145 FOREIGN KEY (aPhoto_id) REFERENCES StorePhoto (id))
you can achieve that by using the migration module.More details you can find #
http://www.playframework.org/modules/migrate
The flow will be like the below:
You push new code to prod --> you run migrations --> restart the server
More documentation at :
https://github.com/dcardon/play-migrate/blob/master/documentation/manual/home.textile
With the latest version play supports migrations :
http://www.playframework.org/documentation/1.2.4/evolutions