重写用户修改密码逻辑,普通用户修改自己、管理员修改自己、管理员修改普通用户,全部通过
大石头 authored at 2017-08-02 21:58:02
8.48 KiB
GitCandy
<?xml version="1.0" encoding="utf-8"?>
<Tables Version="9.5.6420.13918">
  <Table Name="User" Description="用户" DbType="SqlServer">
    <Columns>
      <Column Name="ID" DataType="Int32" Identity="True" PrimaryKey="True" Description="编号" />
      <Column Name="Name" DataType="String" Master="True" Description="名称。登录用户名" />
      <Column Name="Nickname" DataType="String" Description="显示名。昵称、中文名等" />
      <Column Name="Email" DataType="String" Description="邮件" />
      <Column Name="Password" DataType="String" Description="密码" />
      <Column Name="Enable" DataType="Boolean" Description="启用" />
      <Column Name="IsTeam" DataType="Boolean" Description="团队" />
      <Column Name="IsAdmin" DataType="Boolean" Description="管理员" />
      <Column Name="RegisterTime" DataType="DateTime" Description="注册时间" />
      <Column Name="Logins" DataType="Int32" Description="登录" />
      <Column Name="LastLogin" DataType="DateTime" Description="最后登录" />
      <Column Name="LastLoginIP" DataType="String" Description="最后登录IP" />
      <Column Name="Description" DataType="String" Length="500" Description="描述" />
      <Column Name="CreateUserID" DataType="Int32" Description="创建者" />
      <Column Name="CreateTime" DataType="DateTime" Description="创建时间" />
      <Column Name="CreateIP" DataType="String" Description="创建地址" />
      <Column Name="UpdateUserID" DataType="Int32" Description="更新者" />
      <Column Name="UpdateTime" DataType="DateTime" Description="更新时间" />
      <Column Name="UpdateIP" DataType="String" Description="更新地址" />
    </Columns>
    <Indexes>
      <Index Columns="Name" Unique="True" />
    </Indexes>
  </Table>
  <Table Name="Repository" Description="仓库" DbType="SqlServer">
    <Columns>
      <Column Name="ID" DataType="Int32" Identity="True" PrimaryKey="True" Description="编号" />
      <Column Name="OwnerID" DataType="Int32" Description="拥有者" />
      <Column Name="Name" DataType="String" Master="True" Description="名称" />
      <Column Name="Enable" DataType="Boolean" Description="启用" />
      <Column Name="IsPrivate" DataType="Boolean" Description="私有" />
      <Column Name="AllowAnonymousRead" DataType="Boolean" Description="匿名读" />
      <Column Name="AllowAnonymousWrite" DataType="Boolean" Description="匿名写" />
      <Column Name="Commits" DataType="Int32" Description="提交数" />
      <Column Name="Branches" DataType="Int32" Description="分支数" />
      <Column Name="Contributors" DataType="Int32" Description="参与者" />
      <Column Name="Files" DataType="Int32" Description="文件数" />
      <Column Name="Size" DataType="Int64" Description="源码大小" />
      <Column Name="LastCommit" DataType="DateTime" Description="最后提交" />
      <Column Name="Views" DataType="Int32" Description="浏览数" />
      <Column Name="Downloads" DataType="Int32" Description="下载数" />
      <Column Name="LastView" DataType="DateTime" Description="最后浏览" />
      <Column Name="Description" DataType="String" Length="500" Description="描述" />
      <Column Name="CreateUserID" DataType="Int32" Description="创建者" />
      <Column Name="CreateTime" DataType="DateTime" Description="创建时间" />
      <Column Name="CreateIP" DataType="String" Description="创建地址" />
      <Column Name="UpdateUserID" DataType="Int32" Description="更新者" />
      <Column Name="UpdateTime" DataType="DateTime" Description="更新时间" />
      <Column Name="UpdateIP" DataType="String" Description="更新地址" />
    </Columns>
    <Indexes>
      <Index Columns="OwnerID,Name" Unique="True" />
      <Index Columns="OwnerID" />
      <Index Columns="Name" />
    </Indexes>
  </Table>
  <Table Name="UserTeam" Description="用户团队" DbType="SqlServer">
    <Columns>
      <Column Name="ID" DataType="Int32" Identity="True" PrimaryKey="True" Description="编号" />
      <Column Name="UserID" DataType="Int32" Description="用户" />
      <Column Name="TeamID" DataType="Int32" Description="团队" />
      <Column Name="IsAdmin" DataType="Boolean" Description="管理员" />
      <Column Name="CreateUserID" DataType="Int32" Description="创建者" />
      <Column Name="CreateTime" DataType="DateTime" Description="创建时间" />
      <Column Name="CreateIP" DataType="String" Description="创建地址" />
      <Column Name="UpdateUserID" DataType="Int32" Description="更新者" />
      <Column Name="UpdateTime" DataType="DateTime" Description="更新时间" />
      <Column Name="UpdateIP" DataType="String" Description="更新地址" />
    </Columns>
    <Indexes>
      <Index Columns="UserID,TeamID" Unique="True" />
      <Index Columns="UserID" />
      <Index Columns="TeamID" />
    </Indexes>
  </Table>
  <Table Name="UserRepository" Description="用户仓库" DbType="SqlServer">
    <Columns>
      <Column Name="ID" DataType="Int32" Identity="True" PrimaryKey="True" Description="编号" />
      <Column Name="UserID" DataType="Int32" Description="用户" />
      <Column Name="RepositoryID" DataType="Int32" Description="仓库" />
      <Column Name="AllowRead" DataType="Boolean" Description="允许读" />
      <Column Name="AllowWrite" DataType="Boolean" Description="允许写" />
      <Column Name="IsOwner" DataType="Boolean" Description="拥有者" />
      <Column Name="CreateUserID" DataType="Int32" Description="创建者" />
      <Column Name="CreateTime" DataType="DateTime" Description="创建时间" />
      <Column Name="CreateIP" DataType="String" Description="创建地址" />
      <Column Name="UpdateUserID" DataType="Int32" Description="更新者" />
      <Column Name="UpdateTime" DataType="DateTime" Description="更新时间" />
      <Column Name="UpdateIP" DataType="String" Description="更新地址" />
    </Columns>
    <Indexes>
      <Index Columns="UserID,RepositoryID" Unique="True" />
    </Indexes>
  </Table>
  <Table Name="AuthorizationLog" Description="认证日志" DbType="SqlServer">
    <Columns>
      <Column Name="ID" DataType="Int32" Identity="True" PrimaryKey="True" Description="编号" />
      <Column Name="AuthCode" DataType="String" Master="True" Description="认证码" />
      <Column Name="UserID" DataType="Int32" Description="用户" />
      <Column Name="IssueDate" DataType="DateTime" Description="发生时间" />
      <Column Name="Expires" DataType="DateTime" Description="过期时间" />
      <Column Name="IssueIp" DataType="String" Description="发生地址" />
      <Column Name="LastIp" DataType="String" Description="最后地址" />
      <Column Name="IsValid" DataType="Boolean" Description="有效" />
      <Column Name="CreateUserID" DataType="Int32" Description="创建者" />
      <Column Name="CreateTime" DataType="DateTime" Description="创建时间" />
      <Column Name="CreateIP" DataType="String" Description="创建地址" />
      <Column Name="UpdateUserID" DataType="Int32" Description="更新者" />
      <Column Name="UpdateTime" DataType="DateTime" Description="更新时间" />
      <Column Name="UpdateIP" DataType="String" Description="更新地址" />
    </Columns>
    <Indexes>
      <Index Columns="AuthCode" Unique="True" />
      <Index Columns="UserID" />
    </Indexes>
  </Table>
  <Table Name="SshKey" Description="SSH密钥" DbType="SqlServer">
    <Columns>
      <Column Name="ID" DataType="Int32" Identity="True" PrimaryKey="True" Description="编号" />
      <Column Name="UserID" DataType="Int32" Description="用户" />
      <Column Name="KeyType" DataType="String" Description="密钥类型" />
      <Column Name="Fingerprint" DataType="String" Description="指纹" />
      <Column Name="PublicKey" DataType="String" Length="600" Description="公钥" />
      <Column Name="ImportData" DataType="DateTime" Description="导入数据" />
      <Column Name="LastUse" DataType="DateTime" Description="最后使用" />
      <Column Name="CreateUserID" DataType="Int32" Description="创建者" />
      <Column Name="CreateTime" DataType="DateTime" Description="创建时间" />
      <Column Name="CreateIP" DataType="String" Description="创建地址" />
      <Column Name="UpdateUserID" DataType="Int32" Description="更新者" />
      <Column Name="UpdateTime" DataType="DateTime" Description="更新时间" />
      <Column Name="UpdateIP" DataType="String" Description="更新地址" />
    </Columns>
    <Indexes>
      <Index Columns="UserID" Unique="True" />
      <Index Columns="Fingerprint" />
    </Indexes>
  </Table>
</Tables>