vttranlina commented on code in PR #1812:
URL: https://github.com/apache/james-project/pull/1812#discussion_r1405856356


##########
mailbox/postgres/src/main/java/org/apache/james/mailbox/postgres/mail/PostgresMessageModule.java:
##########
@@ -0,0 +1,122 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.mailbox.postgres.mail;
+
+import java.time.LocalDateTime;
+import java.util.UUID;
+
+import org.apache.james.backends.postgres.PostgresIndex;
+import org.apache.james.backends.postgres.PostgresModule;
+import org.apache.james.backends.postgres.PostgresTable;
+import org.apache.james.mailbox.postgres.mail.PostgresCommons.DataTypes;
+import org.jooq.Field;
+import org.jooq.Record;
+import org.jooq.Table;
+import org.jooq.impl.DSL;
+import org.jooq.impl.SQLDataType;
+import org.jooq.postgres.extensions.types.Hstore;
+
+public interface PostgresMessageModule {
+
+    Field<UUID> MESSAGE_ID = DSL.field("message_id", 
SQLDataType.UUID.notNull());
+
+    interface MessageTable {
+        Table<Record> TABLE_NAME = DSL.table("message");
+        Field<UUID> MESSAGE_ID = PostgresMessageModule.MESSAGE_ID;
+        Field<String> BLOB_ID = DSL.field("blob_id", 
SQLDataType.VARCHAR(200).notNull());
+        Field<String> MIME_TYPE = DSL.field("mime_type", 
SQLDataType.VARCHAR(200));
+        Field<String> MIME_SUBTYPE = DSL.field("mime_subtype", 
SQLDataType.VARCHAR(200));
+        Field<LocalDateTime> INTERNAL_DATE = DSL.field("internal_date", 
DataTypes.TIMESTAMP);
+        Field<Long> SIZE = DSL.field("size", SQLDataType.BIGINT.notNull());
+        Field<Integer> BODY_START_OCTET = DSL.field("body_start_octet", 
SQLDataType.INTEGER.notNull());
+        Field<byte[]> HEADER_CONTENT = DSL.field("header_content", 
SQLDataType.BLOB.notNull());

Review Comment:
   It is already `bytea`
   just a jooq syntax
   here is ddl of this table after created
   ```
   create table message
   (
       message_id                     uuid         not null
           primary key,
       blob_id                        varchar(200) not null,
       mime_type                      varchar(200),
       mime_subtype                   varchar(200),
       internal_date                  timestamp(6),
       save_date                      timestamp(6),
       size                           bigint       not null,
       body_start_octet               integer      not null,
       header_content                 bytea        not null,
       textual_line_count             integer,
       content_type_parameters        hstore,
       content_disposition_parameters hstore
   );
   ```
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to