分类 默认分类 下的文章

PowerDesigner->Tools->Execute Commands->Edit/Run Scripts
将代码Copy进去执行就可以了

将Comment中的字符COPY至Name中

Option   Explicit 
ValidationMode   =   True 
InteractiveMode   =   im_Batch
 
Dim   mdl   '   the   current   model
 
'   get   the   current   active   model 
Set   mdl   =   ActiveModel 
If   (mdl   Is   Nothing)   Then 
  MsgBox   "There   is   no   current   Model " 
ElseIf   Not   mdl.IsKindOf(PdPDM.cls_Model)   Then 
  MsgBox   "The   current   model   is   not   an   Physical   Data   model. " 
Else 
  ProcessFolder   mdl 
End   If
 
Private   sub   ProcessFolder(folder) 
On Error Resume Next
  Dim   Tab   'running table 
  for   each   Tab   in   folder.tables 
if   not   tab.isShortcut   then 
  tab.name   =   tab.comment
  Dim   col   '   running   column 
  for   each   col   in   tab.columns 
  if col.comment="" then
  else
col.name=   col.comment 
  end if
  next 
end   if 
  next
 
  Dim   view   'running   view 
  for   each   view   in   folder.Views 
if   not   view.isShortcut   then 
  view.name   =   view.comment 
end   if 
  next
 
  '   go   into   the   sub-packages 
  Dim   f   '   running   folder 
  For   Each   f   In   folder.Packages 
if   not   f.IsShortcut   then 
  ProcessFolder   f 
end   if 
  Next 
end   sub

将Name中的字符COPY至Comment中

Option   Explicit 
ValidationMode   =   True 
InteractiveMode   =   im_Batch
 
Dim   mdl   '   the   current   model
 
'   get   the   current   active   model 
Set   mdl   =   ActiveModel 
If   (mdl   Is   Nothing)   Then 
      MsgBox   "There   is   no   current   Model " 
ElseIf   Not   mdl.IsKindOf(PdPDM.cls_Model)   Then 
      MsgBox   "The   current   model   is   not   an   Physical   Data   model. " 
Else 
      ProcessFolder   mdl 
End   If
 
'   This   routine   copy   name   into   comment   for   each   table,   each   column   and   each   view 
'   of   the   current   folder 
Private   sub   ProcessFolder(folder) 
      Dim   Tab   'running     table 
      for   each   Tab   in   folder.tables 
            if   not   tab.isShortcut   then 
                  tab.comment   =   tab.name 
                  Dim   col   '   running   column 
                  for   each   col   in   tab.columns 
                            col.comment=   col.name 
                  next 
            end   if 
      next
 
      Dim   view   'running   view 
      for   each   view   in   folder.Views 
            if   not   view.isShortcut   then 
                  view.comment   =   view.name 
            end   if 
      next
 
      '   go   into   the   sub-packages 
      Dim   f   '   running   folder 
      For   Each   f   In   folder.Packages 
            if   not   f.IsShortcut   then 
                  ProcessFolder   f 
            end   if 
      Next 
end   sub

将每个表的Code附加到Name前面,格式为:原Code + 空格 + 原Name

Option Explicit
ValidationMode = True
InteractiveMode = im_Batch

Dim mdl ' the current model

' get the current active model
Set mdl = ActiveModel
If (mdl Is Nothing) Then
  MsgBox "There is no current Model"
ElseIf Not mdl.IsKindOf(PdPDM.cls_Model) Then
  MsgBox "The current model is not an Physical Data model."
Else
  ProcessFolder mdl
End If

Private Sub ProcessFolder(folder)
On Error Resume Next
  Dim tab ' running table
  For Each tab In folder.tables
    If Not tab.isShortcut Then
      ' 将Code附加到Name前
      tab.name = tab.code & " " & tab.name
    End If
  Next
  
  ' 递归处理子包
  Dim f ' running folder
  For Each f In folder.Packages
    If Not f.IsShortcut Then
      ProcessFolder f
    End If
  Next
End Sub

1、查看linux中的版本

dotnet --list-runtimes

2、编辑Dockerfile

echo 'FROM mcr.microsoft.com/dotnet/aspnet:6.0.25 AS runtime

# 添加中文字体到正确的位置
#COPY fonts/ /usr/share/fonts/

#时区
RUN cp -r -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
    && echo -ne "timezone Asia/Shanghai. (`uname -rsv`)\n" >> /root/.built

WORKDIR /app' > Dockerfile

3、生成镜像

echo 'docker build -t $1 -f Dockerfile .' > build.sh

权限问题

user: root

docker-compose.yml

version: "3"
services:
  rocketchat:
    image: registry.rocket.chat/rocketchat/rocket.chat:${RELEASE:-latest}
    container_name: sys_chat
    restart: always
    volumes:
      - ./uploads:/app/uploads
    labels:
      traefik.enable: "true"
      traefik.http.routers.rocketchat.rule: Host(`${DOMAIN:-}`)
      traefik.http.routers.rocketchat.tls: "true"
      traefik.http.routers.rocketchat.entrypoints: https
      traefik.http.routers.rocketchat.tls.certresolver: le
    environment:
      MONGO_URL: "${MONGO_URL:-\
        mongodb://${MONGODB_ADVERTISED_HOSTNAME:-mongodb}:${MONGODB_INITIAL_PRIMARY_PORT_NUMBER:-27017}/\
        ${MONGODB_DATABASE:-rocketchat}?replicaSet=${MONGODB_REPLICA_SET_NAME:-rs0}}"
      MONGO_OPLOG_URL: "${MONGO_OPLOG_URL:\
        -mongodb://${MONGODB_ADVERTISED_HOSTNAME:-mongodb}:${MONGODB_INITIAL_PRIMARY_PORT_NUMBER:-27017}/\
        local?replicaSet=${MONGODB_REPLICA_SET_NAME:-rs0}}"
      ROOT_URL: ${ROOT_URL:-http://localhost:${HOST_PORT:-3000}}
      PORT: ${PORT:-3000}
      DEPLOY_METHOD: docker
      DEPLOY_PLATFORM: ${DEPLOY_PLATFORM:-}
      REG_TOKEN: ${REG_TOKEN:-}
    depends_on:
      - mongodb
    expose:
      - ${PORT:-3000}
    ports:
      - "${BIND_IP:-0.0.0.0}:${HOST_PORT:-3000}:${PORT:-3000}"

  mongodb:
    image: docker.io/bitnami/mongodb:${MONGODB_VERSION:-5.0}
    container_name: sys_mongodb
    restart: always
    user: root
    volumes:
      - ./mongodb:/bitnami/mongodb
    environment:
      MONGODB_REPLICA_SET_MODE: primary
      MONGODB_REPLICA_SET_NAME: ${MONGODB_REPLICA_SET_NAME:-rs0}
      MONGODB_PORT_NUMBER: ${MONGODB_PORT_NUMBER:-27017}
      MONGODB_INITIAL_PRIMARY_HOST: ${MONGODB_INITIAL_PRIMARY_HOST:-mongodb}
      MONGODB_INITIAL_PRIMARY_PORT_NUMBER: ${MONGODB_INITIAL_PRIMARY_PORT_NUMBER:-27017}
      MONGODB_ADVERTISED_HOSTNAME: ${MONGODB_ADVERTISED_HOSTNAME:-mongodb}
      MONGODB_ENABLE_JOURNAL: ${MONGODB_ENABLE_JOURNAL:-true}
      ALLOW_EMPTY_PASSWORD: ${ALLOW_EMPTY_PASSWORD:-yes}

chat.conf

server {
  server_name     chat.wdzs.com;
  include         /common/wdzs.com.inc;
  sendfile        on;
  keepalive_timeout  65;
  client_max_body_size 10m;
#  access_log on;
# access_log  /var/log/nginx/srs.log  main;
  location / {
    root  /;
    proxy_pass  http://192.168.100.1:3000/;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto https;
    proxy_set_header X-Nginx-Proxy true;
    proxy_redirect off;
  }
}

excel增加表分区SQL

excel文件:表分区创建.xlsx

添加表分区

#删除旧索引 并重命名
ALTER TABLE xdata_klines_5m DROP CONSTRAINT pk_okx_candles_1m;
ALTER TABLE xdata_klines_5m RENAME TO xdata_klines_5m_00;

create table xdata_klines_5m (
   b_id                 INT2                 not null default 0,
   t_uid                INT8                 not null default 0,
   o                    DECIMAL(20,10)       null default 0.00,
   h                    DECIMAL(20,10)       null default 0.00,
   l                    DECIMAL(20,10)       null default 0.00,
   c                    DECIMAL(20,10)       null default 0.00,
   vol                  DECIMAL(20,2)        null default 0.00,
   vol_b                DECIMAL(20,2)        null default 0.00,
   vol_u                DECIMAL(20,2)        null default 0.00,
   ts                   TIMESTAMP            null,
   constraint PK_OKX_KLINES_5M primary key (b_id, t_uid)
) partition by range (t_uid);

ALTER TABLE xdata_klines_5m  ATTACH PARTITION xdata_klines_5m_00 FOR VALUES FROM (MINVALUE) TO (8418861);

create table xdata_klines_5m_04 partition of xdata_klines_5m FOR VALUES FROM (8500321) TO (8629921);
create table xdata_klines_5m_05 partition of xdata_klines_5m FOR VALUES FROM (8500321) TO (8629921);
create table xdata_klines_5m_06 partition of xdata_klines_5m FOR VALUES FROM (8500321) TO (8629921);

后期增加表分区

ALTER TABLE xdata_klines_5m ATTACH PARTITION xdata_klines_5m_01 FOR VALUES FROM (MINVALUE) TO (8241121);
ALTER TABLE xdata_klines_5m ATTACH PARTITION xdata_klines_5m_02 FOR VALUES FROM (8241121) TO (8500321);
ALTER TABLE xdata_klines_5m ATTACH PARTITION xdata_klines_5m_03 FOR VALUES FROM (8500321) TO (8629921);

删除表分区

ALTER TABLE xdata_klines_5m DETACH PARTITION xdata_klines_5m_02;
ALTER TABLE xdata_klines_5m DETACH PARTITION xdata_klines_5m_03;